mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Do not override snprintf in VS 2015 and newer
MSVC preprocessor triggers #error in <stdio.h> if redefined From MS doc: Beginning with the UCRT in Visual Studio 2015 and Windows 10, snprintf is no longer identical to _snprintf. The snprintf function behavior is now C99 standard compliant. Closes #2255
This commit is contained in:
@@ -269,8 +269,10 @@ int strlcpy(char *, const char *, int);
|
|||||||
#ifndef HAVE_STRSEP
|
#ifndef HAVE_STRSEP
|
||||||
char *strsep(char **, const char *);
|
char *strsep(char **, const char *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define snprintf _snprintf
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||||
|
#define snprintf _snprintf
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Without this, Windows will give us all sorts of crap about using functions
|
/* Without this, Windows will give us all sorts of crap about using functions
|
||||||
like strcpy() even if they are done safely */
|
like strcpy() even if they are done safely */
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ extern "C" int vsnprintf (char *, size_t, const char *, va_list);
|
|||||||
#define putenv _putenv
|
#define putenv _putenv
|
||||||
#define tzset _tzset
|
#define tzset _tzset
|
||||||
|
|
||||||
#if !defined(__GNUC__)
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user