summaryrefslogtreecommitdiffstats
path: root/Tools/AnvilStats/Globals.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-06-03 14:12:01 +0200
committermadmaxoft <github@xoft.cz>2014-06-03 14:12:01 +0200
commit9d1475808c3707062969b8de677df0323f63209a (patch)
tree40d9d2f5f2c73d2e152bb66c9cf0fe56268da70c /Tools/AnvilStats/Globals.h
parentMerge pull request #1052 from mc-server/UnderwaterBaseGen (diff)
parentGenerator article: Added TOC with links. (diff)
downloadcuberite-9d1475808c3707062969b8de677df0323f63209a.tar
cuberite-9d1475808c3707062969b8de677df0323f63209a.tar.gz
cuberite-9d1475808c3707062969b8de677df0323f63209a.tar.bz2
cuberite-9d1475808c3707062969b8de677df0323f63209a.tar.lz
cuberite-9d1475808c3707062969b8de677df0323f63209a.tar.xz
cuberite-9d1475808c3707062969b8de677df0323f63209a.tar.zst
cuberite-9d1475808c3707062969b8de677df0323f63209a.zip
Diffstat (limited to 'Tools/AnvilStats/Globals.h')
-rw-r--r--Tools/AnvilStats/Globals.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tools/AnvilStats/Globals.h b/Tools/AnvilStats/Globals.h
index c673ecb01..df1430cc4 100644
--- a/Tools/AnvilStats/Globals.h
+++ b/Tools/AnvilStats/Globals.h
@@ -24,6 +24,15 @@
#define ALIGN_8
#define ALIGN_16
+ #define FORMATSTRING(formatIndex, va_argsIndex)
+
+ // MSVC has its own custom version of zu format
+ #define SIZE_T_FMT "%Iu"
+ #define SIZE_T_FMT_PRECISION(x) "%" #x "Iu"
+ #define SIZE_T_FMT_HEX "%Ix"
+
+ #define NORETURN __declspec(noreturn)
+
#elif defined(__GNUC__)
// TODO: Can GCC explicitly mark classes as abstract (no instances can be created)?
@@ -40,6 +49,14 @@
// Some portability macros :)
#define stricmp strcasecmp
+ #define FORMATSTRING(formatIndex, va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex)))
+
+ #define SIZE_T_FMT "%zu"
+ #define SIZE_T_FMT_PRECISION(x) "%" #x "zu"
+ #define SIZE_T_FMT_HEX "%zx"
+
+ #define NORETURN __attribute((__noreturn__))
+
#else
#error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler"
@@ -194,6 +211,8 @@ typedef unsigned short UInt16;
/// Faster than (int)floorf((float)x / (float)div)
#define FAST_FLOOR_DIV( x, div ) ( (x) < 0 ? (((int)x / div) - 1) : ((int)x / div) )
+#define TOLUA_TEMPLATE_BIND(...)
+
// Own version of assert() that writes failed assertions to the log for review
#ifdef _DEBUG
#define ASSERT( x ) ( !!(x) || ( LOGERROR("Assertion failed: %s, file %s, line %i", #x, __FILE__, __LINE__ ), assert(0), 0 ) )
@@ -204,6 +223,8 @@ typedef unsigned short UInt16;
// Pretty much the same as ASSERT() but stays in Release builds
#define VERIFY( x ) ( !!(x) || ( LOGERROR("Verification failed: %s, file %s, line %i", #x, __FILE__, __LINE__ ), exit(1), 0 ) )
+typedef unsigned char Byte;
+
@@ -227,3 +248,4 @@ public:
+