Move preprocessor checks into the cross-platform headers themselves

This commit is contained in:
fwcd 2019-04-06 15:41:41 +02:00
commit 9a0340097d
8 changed files with 21 additions and 15 deletions

View file

@ -7,10 +7,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#ifndef _WIN32
#include "winerror_cross_platform.h" #include "winerror_cross_platform.h"
#include "sal_cross_platform.h" #include "sal_cross_platform.h"
#endif
template <typename TType> template <typename TType>
class CalculatorVector class CalculatorVector

View file

@ -14,10 +14,8 @@
* *
\****************************************************************************/ \****************************************************************************/
#ifndef _WIN32
#include "win_data_types_cross_platform.h" #include "win_data_types_cross_platform.h"
#include "sal_cross_platform.h" #include "sal_cross_platform.h"
#endif
#include "CCommand.h" #include "CCommand.h"
#include "EngineStrings.h" #include "EngineStrings.h"

View file

@ -17,10 +17,8 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef _WIN32
#include "win_data_types_cross_platform.h" #include "win_data_types_cross_platform.h"
#include "sal_cross_platform.h" #include "sal_cross_platform.h"
#endif
#include <cstdint> #include <cstdint>
#include <string> #include <string>

View file

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved. // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. // Licensed under the MIT License.
#pragma once #pragma once

View file

@ -27,16 +27,12 @@
#include <future> #include <future>
#include "win_data_types_cross_platform.h" #include "win_data_types_cross_platform.h"
#if defined(_WIN32) && defined(_MSC_VER)
#include <windows.h>
#include <winerror.h>
#else
#include "winerror_cross_platform.h" #include "winerror_cross_platform.h"
#include "sal_cross_platform.h" #include "sal_cross_platform.h"
#include "preprocessor_cross_platform.h" #include "preprocessor_cross_platform.h"
#if defined(_WIN32) && defined(_MSC_VER)
#include <windows.h>
#endif #endif

View file

@ -1,5 +1,9 @@
#pragma once #pragma once
#if !defined(_WIN32) || !defined(_MSC_VER)
// Empty macro definitions for Windows-specific preprocessor directives // Empty macro definitions for Windows-specific preprocessor directives
#define __pragma(x) #define __pragma(x)
#endif

View file

@ -1,5 +1,7 @@
#pragma once #pragma once
#if !defined(_WIN32) || !defined(_MSC_VER)
// Empty macro definitions for source annotations // Empty macro definitions for source annotations
#define _In_opt_ #define _In_opt_
@ -9,3 +11,5 @@
#define _Inout_ #define _Inout_
#define __in_opt #define __in_opt
#define _Frees_ptr_opt_ #define _Frees_ptr_opt_
#endif

View file

@ -1,5 +1,11 @@
#pragma once #pragma once
#if defined(_WIN32) && defined(_MSC_VER)
#include <winerror.h>
#else
#include "CalcErr.h" #include "CalcErr.h"
#define E_ACCESSDENIED 0x80070005 #define E_ACCESSDENIED 0x80070005
@ -15,3 +21,5 @@
#define SUCCEEDED(hr) (((ResultCode)(hr)) >= 0) #define SUCCEEDED(hr) (((ResultCode)(hr)) >= 0)
#define FAILED(hr) (((ResultCode)(hr)) < 0) #define FAILED(hr) (((ResultCode)(hr)) < 0)
#define SCODE_CODE(sc) ((sc) & 0xFFFF) #define SCODE_CODE(sc) ((sc) & 0xFFFF)
#endif