Fix #1359 - add conditional for MSVC, _DEBUG and strdup

This commit is contained in:
Sergey Lyubka 2021-09-27 13:52:39 +01:00
parent c490ff8ae7
commit 46029c501a
2 changed files with 4 additions and 0 deletions

View File

@ -418,8 +418,10 @@ typedef enum { false = 0, true = 1 } bool;
#ifndef __cplusplus #ifndef __cplusplus
#define snprintf _snprintf #define snprintf _snprintf
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
#ifndef strdup // For MSVC with _DEBUG, see #1359
#define strdup(x) _strdup(x) #define strdup(x) _strdup(x)
#endif #endif
#endif
typedef unsigned suseconds_t; typedef unsigned suseconds_t;
typedef int socklen_t; typedef int socklen_t;

View File

@ -51,8 +51,10 @@ typedef enum { false = 0, true = 1 } bool;
#ifndef __cplusplus #ifndef __cplusplus
#define snprintf _snprintf #define snprintf _snprintf
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
#ifndef strdup // For MSVC with _DEBUG, see #1359
#define strdup(x) _strdup(x) #define strdup(x) _strdup(x)
#endif #endif
#endif
typedef unsigned suseconds_t; typedef unsigned suseconds_t;
typedef int socklen_t; typedef int socklen_t;