summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/graph_gui.cpp2
-rw-r--r--src/stdafx.h10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp
index 7427e7088..587f90947 100644
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -39,7 +39,7 @@ enum {
};
/* Apparently these don't play well with enums. */
-static const int64 INVALID_DATAPOINT = LLONG_MAX; // Value used for a datapoint that shouldn't be drawn.
+static const int64 INVALID_DATAPOINT = INT64_MAX; // Value used for a datapoint that shouldn't be drawn.
static const uint INVALID_DATAPOINT_POS = UINT_MAX; // Used to determine if the previous point was drawn.
typedef struct GraphDrawer {
diff --git a/src/stdafx.h b/src/stdafx.h
index 8bff614b4..4d618c903 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -316,4 +316,14 @@ assert_compile(sizeof(uint8) == 1);
# define Point OTTD_AMIGA_POINT
#endif
+// 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__)
+# define __STDC_LIMIT_MACROS
+# include <stdint.h>
+#else
+# define INT64_MAX 9223372036854775807LL
+#endif
+
#endif /* STDAFX_H */