Skip to content

Commit

Permalink
Move Windows-specific stuff to PlatformWindows.inl.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Jan 17, 2016
1 parent a351b08 commit 0c54b40
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions src/Common/Common.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@
<ClInclude Include="object_saver.h" />
<ClInclude Include="object_type_traits.h" />
<ClInclude Include="Platform.hpp" />
<ClInclude Include="PlatformLinux.hpp" />
<ClInclude Include="PlatformWindows.hpp" />
<ClInclude Include="PlatformLinux.inl" />
<ClInclude Include="PlatformWindows.inl" />
<ClInclude Include="Util.hpp" />
<ClInclude Include="_d3d_extensions.h" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Common/Common.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
<ClInclude Include="NvMender2003\remove_isolated_verts.h">
<Filter>NvMender2003</Filter>
</ClInclude>
<ClInclude Include="PlatformWindows.hpp">
<ClInclude Include="Platform.hpp">
<Filter>Platform</Filter>
</ClInclude>
<ClInclude Include="PlatformLinux.hpp">
<ClInclude Include="PlatformLinux.inl">
<Filter>Platform</Filter>
</ClInclude>
<ClInclude Include="Platform.hpp">
<ClInclude Include="PlatformWindows.inl">
<Filter>Platform</Filter>
</ClInclude>
</ItemGroup>
Expand Down
52 changes: 12 additions & 40 deletions src/Common/Platform.hpp
Original file line number Diff line number Diff line change
@@ -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__
Expand All @@ -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 <ctime>
#define ALIGN(a) __declspec(align(a))
#include <sys\utime.h>

#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 <windows.h>
#ifndef __BORLANDC__
#include <windowsx.h>
#if defined(LINUX)
#include "Common/PlatformLinux.inl"
#elif defined(WINDOWS)
#include "Common/PlatformWindows.inl"
#endif
#pragma warning(pop)

#endif
2 changes: 0 additions & 2 deletions src/Common/PlatformLinux.hpp

This file was deleted.

Empty file added src/Common/PlatformLinux.inl
Empty file.
2 changes: 0 additions & 2 deletions src/Common/PlatformWindows.hpp

This file was deleted.

32 changes: 32 additions & 0 deletions src/Common/PlatformWindows.inl
Original file line number Diff line number Diff line change
@@ -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 <windows.h>
#include <windowsx.h>
#pragma warning(pop)

0 comments on commit 0c54b40

Please sign in to comment.