mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-06 13:37:34 +08:00
Workaround for WIN32 C++ snprintf/vsnprintf/strdup calls
This commit is contained in:
parent
abfd81cb9d
commit
2cf1b09767
@ -254,9 +254,14 @@ enum { false = 0, true = 1 };
|
||||
#endif
|
||||
|
||||
#include <winsock2.h>
|
||||
|
||||
// See https://github.com/cesanta/mongoose/issues/1047
|
||||
#ifndef __cplusplus
|
||||
#define snprintf _snprintf
|
||||
#define vsnprintf _vsnprintf
|
||||
#define strdup(x) _strdup(x)
|
||||
#endif
|
||||
|
||||
typedef int socklen_t;
|
||||
#define PATH_MAX MAX_PATH
|
||||
#define MG_DIRSEP '\\'
|
||||
|
@ -18,9 +18,15 @@ enum { false = 0, true = 1 };
|
||||
#endif
|
||||
|
||||
#include <winsock2.h>
|
||||
|
||||
// Protect from calls like std::snprintf in app code
|
||||
// See https://github.com/cesanta/mongoose/issues/1047
|
||||
#ifndef __cplusplus
|
||||
#define snprintf _snprintf
|
||||
#define vsnprintf _vsnprintf
|
||||
#define strdup(x) _strdup(x)
|
||||
#endif
|
||||
|
||||
typedef int socklen_t;
|
||||
#define PATH_MAX MAX_PATH
|
||||
#define MG_DIRSEP '\\'
|
||||
|
Loading…
Reference in New Issue
Block a user