diff options
author | Mattes D <github@xoft.cz> | 2014-06-01 15:19:01 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-06-01 15:19:01 +0200 |
commit | 869cd7a2080d6072f90016afd7067f871482a5ac (patch) | |
tree | 3c330c6e7408e4eb9117d8876f546cd86b94d034 /Tools/AnvilStats/Globals.h | |
parent | Merge branch 'master' into GeneratorArticle (diff) | |
download | cuberite-869cd7a2080d6072f90016afd7067f871482a5ac.tar cuberite-869cd7a2080d6072f90016afd7067f871482a5ac.tar.gz cuberite-869cd7a2080d6072f90016afd7067f871482a5ac.tar.bz2 cuberite-869cd7a2080d6072f90016afd7067f871482a5ac.tar.lz cuberite-869cd7a2080d6072f90016afd7067f871482a5ac.tar.xz cuberite-869cd7a2080d6072f90016afd7067f871482a5ac.tar.zst cuberite-869cd7a2080d6072f90016afd7067f871482a5ac.zip |
Diffstat (limited to 'Tools/AnvilStats/Globals.h')
-rw-r--r-- | Tools/AnvilStats/Globals.h | 22 |
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: + |