diff options
author | glx <glx@openttd.org> | 2018-12-09 02:28:14 +0100 |
---|---|---|
committer | glx22 <glx22@users.noreply.github.com> | 2018-12-27 18:09:16 +0100 |
commit | c540d7244531d501f16b485a3e45e358f98853be (patch) | |
tree | 4d270f06b2aa9b4f796d4828e5bfaf3c09cdd4b1 /src/stdafx.h | |
parent | 8890926b0d1069aec7ef53fd84868a7a3ca02c05 (diff) | |
download | openttd-c540d7244531d501f16b485a3e45e358f98853be.tar.xz |
Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32
Diffstat (limited to 'src/stdafx.h')
-rw-r--r-- | src/stdafx.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/stdafx.h b/src/stdafx.h index fb384ca82..6e96e98fd 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -167,7 +167,7 @@ #include <malloc.h> // alloca() #endif -#if defined(WIN32) +#if defined(_WIN32) #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #endif @@ -232,18 +232,18 @@ #define FALLTHROUGH #endif - #if defined(WIN32) && !defined(_WIN64) && !defined(WIN64) +# if defined(_WIN32) && !defined(_WIN64) #if !defined(_W64) #define _W64 #endif typedef _W64 int INT_PTR, *PINT_PTR; typedef _W64 unsigned int UINT_PTR, *PUINT_PTR; - #endif /* WIN32 && !_WIN64 && !WIN64 */ +# endif /* _WIN32 && !_WIN64 */ - #if defined(_WIN64) || defined(WIN64) +# if defined(_WIN64) #define fseek _fseeki64 - #endif /* _WIN64 || WIN64 */ +# endif /* _WIN64 */ /* zlib from vcpkg use cdecl calling convention without enforcing it in the headers */ # if defined(WITH_ZLIB) @@ -281,7 +281,7 @@ /* NOTE: the string returned by these functions is only valid until the next * call to the same function and is not thread- or reentrancy-safe */ #if !defined(STRGEN) && !defined(SETTINGSGEN) - #if defined(WIN32) || defined(WIN64) +# if defined(_WIN32) char *getcwd(char *buf, size_t size); #include <tchar.h> #include <io.h> @@ -292,14 +292,14 @@ const char *FS2OTTD(const TCHAR *name); const TCHAR *OTTD2FS(const char *name, bool console_cp = false); - #else +# else #define fopen(file, mode) fopen(OTTD2FS(file), mode) const char *FS2OTTD(const char *name); const char *OTTD2FS(const char *name); - #endif /* WIN32 */ +# endif /* _WIN32 */ #endif /* STRGEN || SETTINGSGEN */ -#if defined(WIN32) || defined(WIN64) || defined(__OS2__) && !defined(__INNOTEK_LIBC__) +#if defined(_WIN32) || defined(__OS2__) && !defined(__INNOTEK_LIBC__) #define PATHSEP "\\" #define PATHSEPCHAR '\\' #else |