diff --git a/src/Common/Common.vcxproj b/src/Common/Common.vcxproj index dea9fb24dfa..8d0ad30f38c 100644 --- a/src/Common/Common.vcxproj +++ b/src/Common/Common.vcxproj @@ -127,8 +127,8 @@ - - + + diff --git a/src/Common/Common.vcxproj.filters b/src/Common/Common.vcxproj.filters index 2a1c44040e0..bfe31483d70 100644 --- a/src/Common/Common.vcxproj.filters +++ b/src/Common/Common.vcxproj.filters @@ -30,13 +30,13 @@ NvMender2003 - + Platform - + Platform - + Platform diff --git a/src/Common/Platform.hpp b/src/Common/Platform.hpp index 3bde2c64dac..9282889c0f0 100644 --- a/src/Common/Platform.hpp +++ b/src/Common/Platform.hpp @@ -1,19 +1,12 @@ -#ifndef XRCORE_PLATFORM_H -#define XRCORE_PLATFORM_H #pragma once +#include "Common/Config.hpp" -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#ifndef STRICT -# define STRICT // Enable strict syntax -#endif // STRICT -#define IDIRECTPLAY2_OR_GREATER // ? -#define DIRECTINPUT_VERSION 0x0800 // -#define _CRT_SECURE_NO_DEPRECATE // vc8.0 stuff, don't deprecate several ANSI functions - -// windows.h -#ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0501 +#if defined(__linux__) +#define LINUX +#elif defined(_WIN32) +#define WINDOWS +#else +#error Unsupported platform #endif #ifdef __GNUC__ @@ -37,34 +30,13 @@ # define ICF __forceinline // !!! this should be used only in critical places found by PROFILER # define ICN __declspec (noinline) #endif +#define ALIGN(a) __declspec(align(a)) #include -#define ALIGN(a) __declspec(align(a)) #include -#define NOGDICAPMASKS -//#define NOSYSMETRICS -#define NOMENUS -#define NOICONS -#define NOKEYSTATES -#define NODRAWTEXT -#define NOMEMMGR -#define NOMETAFILE -#define NOSERVICE -#define NOCOMM -#define NOHELP -#define NOPROFILER -#define NOMCX -#define NOMINMAX -#define DOSWIN32 -#define _WIN32_DCOM - -#pragma warning(push) -#pragma warning(disable:4005) -#include -#ifndef __BORLANDC__ -#include +#if defined(LINUX) +#include "Common/PlatformLinux.inl" +#elif defined(WINDOWS) +#include "Common/PlatformWindows.inl" #endif -#pragma warning(pop) - -#endif \ No newline at end of file diff --git a/src/Common/PlatformLinux.hpp b/src/Common/PlatformLinux.hpp deleted file mode 100644 index fc3731d9d2f..00000000000 --- a/src/Common/PlatformLinux.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "Common/Config.hpp" diff --git a/src/Common/PlatformLinux.inl b/src/Common/PlatformLinux.inl new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/Common/PlatformWindows.hpp b/src/Common/PlatformWindows.hpp deleted file mode 100644 index fc3731d9d2f..00000000000 --- a/src/Common/PlatformWindows.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "Common/Config.hpp" diff --git a/src/Common/PlatformWindows.inl b/src/Common/PlatformWindows.inl new file mode 100644 index 00000000000..26f65e320ae --- /dev/null +++ b/src/Common/PlatformWindows.inl @@ -0,0 +1,32 @@ +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#define IDIRECTPLAY2_OR_GREATER // ? +#define DIRECTINPUT_VERSION 0x0800 // +#define _CRT_SECURE_NO_DEPRECATE // vc8.0 stuff, don't deprecate several ANSI functions + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 +#endif + +#define NOGDICAPMASKS +//#define NOSYSMETRICS +#define NOMENUS +#define NOICONS +#define NOKEYSTATES +#define NODRAWTEXT +#define NOMEMMGR +#define NOMETAFILE +#define NOSERVICE +#define NOCOMM +#define NOHELP +#define NOPROFILER +#define NOMCX +#define NOMINMAX +#define DOSWIN32 +#define _WIN32_DCOM + +#pragma warning(push) +#pragma warning(disable:4005) // macro redefinition +#include +#include +#pragma warning(pop)