summaryrefslogtreecommitdiff
path: root/src/strgen
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2018-12-09 02:28:14 +0100
committerglx22 <glx22@users.noreply.github.com>2018-12-27 18:09:16 +0100
commitc540d7244531d501f16b485a3e45e358f98853be (patch)
tree4d270f06b2aa9b4f796d4828e5bfaf3c09cdd4b1 /src/strgen
parent8890926b0d1069aec7ef53fd84868a7a3ca02c05 (diff)
downloadopenttd-c540d7244531d501f16b485a3e45e358f98853be.tar.xz
Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32
Diffstat (limited to 'src/strgen')
-rw-r--r--src/strgen/strgen.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index c231717da..44cbd127a 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -21,14 +21,14 @@
#include <stdarg.h>
#include <exception>
-#if (!defined(WIN32) && !defined(WIN64)) || defined(__CYGWIN__)
+#if !defined(_WIN32) || defined(__CYGWIN__)
#include <unistd.h>
#include <sys/stat.h>
#endif
-#if defined WIN32 || defined __WATCOMC__
+#if defined(_WIN32) || defined(__WATCOMC__)
#include <direct.h>
-#endif /* WIN32 || __WATCOMC__ */
+#endif /* _WIN32 || __WATCOMC__ */
#ifdef __MORPHOS__
#ifdef stderr
@@ -333,9 +333,9 @@ struct HeaderFileWriter : HeaderWriter, FileWriter {
unlink(this->filename);
} else {
/* else rename tmp.xxx into filename */
- #if defined(WIN32) || defined(WIN64)
+# if defined(_WIN32)
unlink(this->real_filename);
- #endif
+# endif
if (rename(this->filename, this->real_filename) == -1) error("rename() failed");
}
}
@@ -377,7 +377,7 @@ static inline void ottd_mkdir(const char *directory)
{
/* Ignore directory creation errors; they'll surface later on, and most
* of the time they are 'directory already exists' errors anyhow. */
-#if defined(WIN32) || defined(__WATCOMC__)
+#if defined(_WIN32) || defined(__WATCOMC__)
mkdir(directory);
#else
mkdir(directory, 0755);