···2020 #endif
2121#endif
22222323-// Visual C does not support C99 (which includes a safe snprintf)
2424-#ifdef _MSC_VER
2525-#define snprintf c99_snprintf
2626-// From Valentin Milea: http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
2727-static_inline int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap)
2828-{
2929- int count = -1;
2323+// Old Visual C did not support C99 (which includes a safe snprintf)
2424+#if defined(_MSC_VER) && (_MSC_VER < 1900)
2525+ #define snprintf c99_snprintf
2626+ // From Valentin Milea: http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
2727+ static_inline int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap)
2828+ {
2929+ int count = -1;
30303131- if (size != 0)
3232- count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
3333- if (count == -1)
3434- count = _vscprintf(format, ap);
3131+ if (size != 0)
3232+ count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
3333+ if (count == -1)
3434+ count = _vscprintf(format, ap);
35353636- return count;
3737-}
3636+ return count;
3737+ }
38383939-static_inline int c99_snprintf(char* str, size_t size, const char* format, ...)
4040-{
4141- int count;
4242- va_list ap;
3939+ static_inline int c99_snprintf(char* str, size_t size, const char* format, ...)
4040+ {
4141+ int count;
4242+ va_list ap;
43434444- va_start(ap, format);
4545- count = c99_vsnprintf(str, size, format, ap);
4646- va_end(ap);
4444+ va_start(ap, format);
4545+ count = c99_vsnprintf(str, size, format, ap);
4646+ va_end(ap);
47474848- return count;
4949-}
4848+ return count;
4949+ }
5050#endif
51515252
+2-2
src/renderer_GL_common.inl
···3535#define __func__ __FUNCTION__
3636#endif
37373838-// Visual C does not support C99 (which includes a safe snprintf)
3939-#ifdef _MSC_VER
3838+// Old Visual C did not support C99 (which includes a safe snprintf)
3939+#if defined(_MSC_VER) && (_MSC_VER < 1900)
4040 #define snprintf c99_snprintf
4141 // From Valentin Milea: http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
4242 static_inline int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap)