Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32

This commit is contained in:
glx
2018-12-09 02:28:14 +01:00
committed by glx22
parent 8890926b0d
commit c540d72445
25 changed files with 74 additions and 74 deletions

View File

@@ -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