this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fixed snprintf declarations for MSVC 2015.

+24 -24
+22 -22
src/SDL_gpu_matrix.c
··· 20 20 #endif 21 21 #endif 22 22 23 - // Visual C does not support C99 (which includes a safe snprintf) 24 - #ifdef _MSC_VER 25 - #define snprintf c99_snprintf 26 - // From Valentin Milea: http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 27 - static_inline int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap) 28 - { 29 - int count = -1; 23 + // Old Visual C did not support C99 (which includes a safe snprintf) 24 + #if defined(_MSC_VER) && (_MSC_VER < 1900) 25 + #define snprintf c99_snprintf 26 + // From Valentin Milea: http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 27 + static_inline int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap) 28 + { 29 + int count = -1; 30 30 31 - if (size != 0) 32 - count = _vsnprintf_s(str, size, _TRUNCATE, format, ap); 33 - if (count == -1) 34 - count = _vscprintf(format, ap); 31 + if (size != 0) 32 + count = _vsnprintf_s(str, size, _TRUNCATE, format, ap); 33 + if (count == -1) 34 + count = _vscprintf(format, ap); 35 35 36 - return count; 37 - } 36 + return count; 37 + } 38 38 39 - static_inline int c99_snprintf(char* str, size_t size, const char* format, ...) 40 - { 41 - int count; 42 - va_list ap; 39 + static_inline int c99_snprintf(char* str, size_t size, const char* format, ...) 40 + { 41 + int count; 42 + va_list ap; 43 43 44 - va_start(ap, format); 45 - count = c99_vsnprintf(str, size, format, ap); 46 - va_end(ap); 44 + va_start(ap, format); 45 + count = c99_vsnprintf(str, size, format, ap); 46 + va_end(ap); 47 47 48 - return count; 49 - } 48 + return count; 49 + } 50 50 #endif 51 51 52 52
+2 -2
src/renderer_GL_common.inl
··· 35 35 #define __func__ __FUNCTION__ 36 36 #endif 37 37 38 - // Visual C does not support C99 (which includes a safe snprintf) 39 - #ifdef _MSC_VER 38 + // Old Visual C did not support C99 (which includes a safe snprintf) 39 + #if defined(_MSC_VER) && (_MSC_VER < 1900) 40 40 #define snprintf c99_snprintf 41 41 // From Valentin Milea: http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 42 42 static_inline int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap)