Fuck the industry domination of C++ and its standard not forcing compliance in both C and C++ modes, if this is the case here. If not, then fuck MSVC.

This commit is contained in:
Pietro Gagliardi 2019-05-27 11:18:05 -04:00
parent a6c1e1ed17
commit 79ecadb909
2 changed files with 8 additions and 1 deletions

View File

@ -30,7 +30,7 @@ void uiprivInternalError(const char *fmt, ...)
}
static const char *messages[uiprivNumProgrammerErrors] = {
[uiprivProgrammerErrorWrongStructSize] = "wrong size %zu for %s",
[uiprivProgrammerErrorWrongStructSize] = "wrong size %" uiprivSizetPrintf " for %s",
[uiprivProgrammerErrorIndexOutOfRange] = "index %d out of range in %s()",
[uiprivProgrammerErrorNullPointer] = "invalid null pointer for %s passed into %s()",
[uiprivProgrammerErrorIntIDNotFound] = "%s identifier %d not found in %s()",

View File

@ -11,6 +11,13 @@ extern "C" {
#define uiprivFunc __func__
#endif
// TODO WHY IS THIS NEEDED?!?!?!?!!?!??!Q https://stackoverflow.com/questions/15610053/correct-printf-format-specifier-for-size-t-zu-or-iu SAYS THAT VS2013 DOES SUPPORT %zu
#ifdef _MSC_VER
#define uiprivSizetPrintf "Iu"
#else
#define uiprivSizetPrintf "zu"
#endif
// init.c
extern const char **uiprivSysInitErrors(void);
extern int uiprivSysInit(void *options, uiInitError *err);