summaryrefslogtreecommitdiff
path: root/src/stdafx.h
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-10-21 10:53:23 +0000
committerbjarni <bjarni@openttd.org>2007-10-21 10:53:23 +0000
commitd8fe1e3bb4865669c89f74822ec20a1cb37e0858 (patch)
treee145fe1c62b4987d7198c9abdb1c9aca8ca81595 /src/stdafx.h
parent57b92e21eeab9041e5058449165863e101f918ed (diff)
downloadopenttd-d8fe1e3bb4865669c89f74822ec20a1cb37e0858.tar.xz
(svn r11325) -Fix (r11312)[FS#1357]: [OSX] fixed compilation on OSX
Diffstat (limited to 'src/stdafx.h')
-rw-r--r--src/stdafx.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 20f565679..d9bf34835 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -8,8 +8,11 @@
/* It seems that we need to include stdint.h before anything else
* We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC
* does not have stdint.h and apparently neither does MorphOS, so define
- * INT64_MAX for them ourselves. */
-#if !defined(_MSC_VER) && !defined( __MORPHOS__)
+ * INT64_MAX for them ourselves.
+ * Sometimes OSX headers manages to include stdint.h before this but without
+ * __STDC_LIMIT_MACROS so it will be without INT64_*. We need to define those
+ * too if this is the case. */
+#if !defined(_MSC_VER) && !defined( __MORPHOS__) && !defined(_STDINT_H_)
# if defined (SUNOS)
/* SunOS/Solaris does not have stdint.h, but inttypes.h defines everything
* stdint.h defines and we need. */
@@ -20,7 +23,7 @@
# endif
#else
# define INT64_MAX 9223372036854775807LL
-# define INT64_MIN -9223372036854775808LL
+# define INT64_MIN (-INT64_MAX - 1)
#endif
#include <cstdio>