diff options
author | Mattes D <github@xoft.cz> | 2014-07-01 08:54:44 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-07-01 08:54:44 +0200 |
commit | 24c86df12ecf69ae3ddaf707b2116b73c45402cc (patch) | |
tree | 92fe7519642865c344f5efcd974208ac11daea2a /src | |
parent | Fixed cFile compilation under MinGW. (diff) | |
parent | Proper sqlite dependency fix. (diff) | |
download | cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar.gz cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar.bz2 cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar.lz cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar.xz cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar.zst cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.zip |
Diffstat (limited to '')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/Globals.h | 21 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2f4d6ea13..b1b880b7b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -261,4 +261,4 @@ endif () if (WIN32) target_link_libraries(${EXECUTABLE} expat tolualib ws2_32.lib Psapi.lib) endif() -target_link_libraries(${EXECUTABLE} luaexpat iniFile jsoncpp polarssl zlib lua sqlite) +target_link_libraries(${EXECUTABLE} luaexpat iniFile jsoncpp polarssl zlib sqlite lua) diff --git a/src/Globals.h b/src/Globals.h index c5768facf..0c11429bd 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -71,9 +71,24 @@ #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" + #if defined(_WIN32) + // We're compiling on MinGW, which uses an old MSVCRT library that has no support for size_t printfing. + // We need direct size formats: + #if defined(_WIN64) + #define SIZE_T_FMT "%I64u" + #define SIZE_T_FMT_PRECISION(x) "%" #x "I64u" + #define SIZE_T_FMT_HEX "%I64x" + #else + #define SIZE_T_FMT "%u" + #define SIZE_T_FMT_PRECISION(x) "%" #x "u" + #define SIZE_T_FMT_HEX "%x" + #endif + #else + // We're compiling on Linux, so we can use libc's size_t printf format: + #define SIZE_T_FMT "%zu" + #define SIZE_T_FMT_PRECISION(x) "%" #x "zu" + #define SIZE_T_FMT_HEX "%zx" + #endif #define NORETURN __attribute((__noreturn__)) |