Mercurial > hg > index.cgi
comparison 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 |
comparison
equal
deleted
inserted
replaced
546:80b21c6b4a6b | 547:33e37b3d98cf |
---|---|
20 */ | 20 */ |
21 | 21 |
22 #ifndef ___lw_win_h_seen___ | 22 #ifndef ___lw_win_h_seen___ |
23 #define ___lw_win_h_seen___ | 23 #define ___lw_win_h_seen___ |
24 | 24 |
25 #ifdef _MSC_VER | |
26 | |
25 #include "lw_string.h" | 27 #include "lw_string.h" |
26 #include <string.h> | 28 #include <string.h> |
27 | 29 |
28 #define strcasecmp _stricmp | 30 #define strcasecmp _stricmp |
29 #define strncasecmp _strnicmp | 31 #define strncasecmp _strnicmp |
30 #define unlink _unlink | 32 #define unlink _unlink |
31 | 33 |
34 | |
35 #if _MSC_VER < 1900 | |
36 // For older Microsoft stuff without snprintf | |
32 int c99_snprintf(char* str, size_t size, const char* format, ...); | 37 int c99_snprintf(char* str, size_t size, const char* format, ...); |
33 | 38 |
34 #define snprintf c99_snprintf | 39 #define snprintf c99_snprintf |
40 #endif | |
41 | |
42 #endif // _MSC_VER defined | |
35 | 43 |
36 #endif /* ___lw_win_h_seen___ */ | 44 #endif /* ___lw_win_h_seen___ */ |