diff lwlib/lw_win.h @ 547:33e37b3d98cf

Don't build snprintf() emulation on modern enough MSVC MSVC 2015 and later have a C99 compliant snprintf() so don't build the emulation function for it if building on a modern enough version.
author William Astle <lost@l-w.ca>
date Thu, 16 Mar 2023 16:18:13 -0600
parents 4130ffdeb5c8
children
line wrap: on
line diff
--- a/lwlib/lw_win.h	Thu Mar 16 16:03:20 2023 -0600
+++ b/lwlib/lw_win.h	Thu Mar 16 16:18:13 2023 -0600
@@ -21,6 +21,8 @@
 
 #ifndef ___lw_win_h_seen___
 #define ___lw_win_h_seen___
+
+#ifdef _MSC_VER
 
 #include "lw_string.h"
 #include <string.h>
@@ -29,8 +31,14 @@
 #define strncasecmp _strnicmp
 #define unlink _unlink
 
+
+#if _MSC_VER < 1900
+// For older Microsoft stuff without snprintf
 int c99_snprintf(char* str, size_t size, const char* format, ...);
 
 #define snprintf c99_snprintf
+#endif
+
+#endif // _MSC_VER defined
 
 #endif /* ___lw_win_h_seen___ */