Skip to content

Commit 0c54b40

Browse files
author
nitrocaster
committed
Move Windows-specific stuff to PlatformWindows.inl.
1 parent a351b08 commit 0c54b40

File tree

7 files changed

+49
-49
lines changed

7 files changed

+49
-49
lines changed

src/Common/Common.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@
127127
<ClInclude Include="object_saver.h" />
128128
<ClInclude Include="object_type_traits.h" />
129129
<ClInclude Include="Platform.hpp" />
130-
<ClInclude Include="PlatformLinux.hpp" />
131-
<ClInclude Include="PlatformWindows.hpp" />
130+
<ClInclude Include="PlatformLinux.inl" />
131+
<ClInclude Include="PlatformWindows.inl" />
132132
<ClInclude Include="Util.hpp" />
133133
<ClInclude Include="_d3d_extensions.h" />
134134
</ItemGroup>

src/Common/Common.vcxproj.filters

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
<ClInclude Include="NvMender2003\remove_isolated_verts.h">
3131
<Filter>NvMender2003</Filter>
3232
</ClInclude>
33-
<ClInclude Include="PlatformWindows.hpp">
33+
<ClInclude Include="Platform.hpp">
3434
<Filter>Platform</Filter>
3535
</ClInclude>
36-
<ClInclude Include="PlatformLinux.hpp">
36+
<ClInclude Include="PlatformLinux.inl">
3737
<Filter>Platform</Filter>
3838
</ClInclude>
39-
<ClInclude Include="Platform.hpp">
39+
<ClInclude Include="PlatformWindows.inl">
4040
<Filter>Platform</Filter>
4141
</ClInclude>
4242
</ItemGroup>

src/Common/Platform.hpp

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
#ifndef XRCORE_PLATFORM_H
2-
#define XRCORE_PLATFORM_H
31
#pragma once
2+
#include "Common/Config.hpp"
43

5-
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
6-
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
7-
#ifndef STRICT
8-
# define STRICT // Enable strict syntax
9-
#endif // STRICT
10-
#define IDIRECTPLAY2_OR_GREATER // ?
11-
#define DIRECTINPUT_VERSION 0x0800 //
12-
#define _CRT_SECURE_NO_DEPRECATE // vc8.0 stuff, don't deprecate several ANSI functions
13-
14-
// windows.h
15-
#ifndef _WIN32_WINNT
16-
# define _WIN32_WINNT 0x0501
4+
#if defined(__linux__)
5+
#define LINUX
6+
#elif defined(_WIN32)
7+
#define WINDOWS
8+
#else
9+
#error Unsupported platform
1710
#endif
1811

1912
#ifdef __GNUC__
@@ -37,34 +30,13 @@
3730
# define ICF __forceinline // !!! this should be used only in critical places found by PROFILER
3831
# define ICN __declspec (noinline)
3932
#endif
33+
#define ALIGN(a) __declspec(align(a))
4034

4135
#include <ctime>
42-
#define ALIGN(a) __declspec(align(a))
4336
#include <sys\utime.h>
4437

45-
#define NOGDICAPMASKS
46-
//#define NOSYSMETRICS
47-
#define NOMENUS
48-
#define NOICONS
49-
#define NOKEYSTATES
50-
#define NODRAWTEXT
51-
#define NOMEMMGR
52-
#define NOMETAFILE
53-
#define NOSERVICE
54-
#define NOCOMM
55-
#define NOHELP
56-
#define NOPROFILER
57-
#define NOMCX
58-
#define NOMINMAX
59-
#define DOSWIN32
60-
#define _WIN32_DCOM
61-
62-
#pragma warning(push)
63-
#pragma warning(disable:4005)
64-
#include <windows.h>
65-
#ifndef __BORLANDC__
66-
#include <windowsx.h>
38+
#if defined(LINUX)
39+
#include "Common/PlatformLinux.inl"
40+
#elif defined(WINDOWS)
41+
#include "Common/PlatformWindows.inl"
6742
#endif
68-
#pragma warning(pop)
69-
70-
#endif

src/Common/PlatformLinux.hpp

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/Common/PlatformLinux.inl

Whitespace-only changes.

src/Common/PlatformWindows.hpp

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/Common/PlatformWindows.inl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
2+
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
3+
#define IDIRECTPLAY2_OR_GREATER // ?
4+
#define DIRECTINPUT_VERSION 0x0800 //
5+
#define _CRT_SECURE_NO_DEPRECATE // vc8.0 stuff, don't deprecate several ANSI functions
6+
7+
#ifndef _WIN32_WINNT
8+
#define _WIN32_WINNT 0x0501
9+
#endif
10+
11+
#define NOGDICAPMASKS
12+
//#define NOSYSMETRICS
13+
#define NOMENUS
14+
#define NOICONS
15+
#define NOKEYSTATES
16+
#define NODRAWTEXT
17+
#define NOMEMMGR
18+
#define NOMETAFILE
19+
#define NOSERVICE
20+
#define NOCOMM
21+
#define NOHELP
22+
#define NOPROFILER
23+
#define NOMCX
24+
#define NOMINMAX
25+
#define DOSWIN32
26+
#define _WIN32_DCOM
27+
28+
#pragma warning(push)
29+
#pragma warning(disable:4005) // macro redefinition
30+
#include <windows.h>
31+
#include <windowsx.h>
32+
#pragma warning(pop)

0 commit comments

Comments
 (0)