diff --git a/code/qcommon/q_shared.c b/code/qcommon/q_shared.c index 820c862c..aa17f1c1 100644 --- a/code/qcommon/q_shared.c +++ b/code/qcommon/q_shared.c @@ -746,13 +746,14 @@ qboolean Q_isintegral( float f ) return (int)f == f; } -#ifdef _MSC_VER +#ifdef _WIN32 /* ============= Q_vsnprintf - + Special wrapper function for Microsoft's broken _vsnprintf() function. -MinGW comes with its own snprintf() which is not broken. +MinGW comes with its own vsnprintf() which is not broken. mingw-w64 +however, uses Microsoft's broken _vsnprintf() function. ============= */ diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index 4c1b821a..629334af 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -177,13 +177,15 @@ typedef int intptr_t; typedef unsigned __int32 uint32_t; typedef unsigned __int16 uint16_t; typedef unsigned __int8 uint8_t; +#else + #include +#endif +#ifdef _WIN32 // vsnprintf is ISO/IEC 9899:1999 // abstracting this to make it portable int Q_vsnprintf(char *str, size_t size, const char *format, va_list ap); #else - #include - #define Q_vsnprintf vsnprintf #endif