summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-03-12 18:12:13 +0100
committerTycho <work.tycho+git@gmail.com>2014-03-12 18:12:13 +0100
commitd904e89712ee87b4b2bb73c6568f230fff15933a (patch)
tree50b4530dde0a80d1271c3bc1dab770f1f69fc7cd /src/Globals.h
parentAdded macros support to tools (diff)
parentFixed printf format compatabilty (diff)
downloadcuberite-d904e89712ee87b4b2bb73c6568f230fff15933a.tar
cuberite-d904e89712ee87b4b2bb73c6568f230fff15933a.tar.gz
cuberite-d904e89712ee87b4b2bb73c6568f230fff15933a.tar.bz2
cuberite-d904e89712ee87b4b2bb73c6568f230fff15933a.tar.lz
cuberite-d904e89712ee87b4b2bb73c6568f230fff15933a.tar.xz
cuberite-d904e89712ee87b4b2bb73c6568f230fff15933a.tar.zst
cuberite-d904e89712ee87b4b2bb73c6568f230fff15933a.zip
Diffstat (limited to '')
-rw-r--r--src/Globals.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Globals.h b/src/Globals.h
index e907614d7..faa168c59 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -41,6 +41,9 @@
#define FORMATSTRING(formatIndex,va_argsIndex)
+ // MSVC has its own custom version of zu format
+ #define SIZE_T_FMT "%Iu"
+
#elif defined(__GNUC__)
// TODO: Can GCC explicitly mark classes as abstract (no instances can be created)?
@@ -61,6 +64,8 @@
#define FORMATSTRING(formatIndex,va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex)))
+ #define SIZE_T_FMT "%zu"
+
#else
#error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler"
@@ -240,7 +245,7 @@ template class SizeChecker<UInt16, 2>;
// Same as assert but in all Self test builds
#ifdef SELF_TEST
-#define assert_test(x) ( !!(x) || (assert(0), exit(1), 0))
+#define assert_test(x) ( !!(x) || (assert(!#x), exit(1), 0))
#endif
/// A generic interface used mainly in ForEach() functions
@@ -265,6 +270,14 @@ T Clamp(T a_Value, T a_Min, T a_Max)
+#ifndef TOLUA_TEMPLATE_BIND
+#define TOLUA_TEMPLATE_BIND(x)
+#endif
+
+
+
+
+
// Common headers (part 2, with macros):
#include "ChunkDef.h"
#include "BiomeDef.h"