mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-21 19:51:50 +00:00
Workaround for WIN32 C++ snprintf/vsnprintf/strdup calls
This commit is contained in:
1 parent
abfd81cb9d
commit
2cf1b09767
2 files changed
+11
No files matched your search
@@ -254,9 +254,14 @@ enum { false = 0, true = 1 };
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
|
||||||
|
// See https://github.com/cesanta/mongoose/issues/1047
|
||||||
|
#ifndef __cplusplus
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define vsnprintf _vsnprintf
|
#define vsnprintf _vsnprintf
|
||||||
#define strdup(x) _strdup(x)
|
#define strdup(x) _strdup(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#define PATH_MAX MAX_PATH
|
#define PATH_MAX MAX_PATH
|
||||||
#define MG_DIRSEP '\\'
|
#define MG_DIRSEP '\\'
|
||||||
|
|||||||
@@ -18,9 +18,15 @@ enum { false = 0, true = 1 };
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <winsock2.h>
|
#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 snprintf _snprintf
|
||||||
#define vsnprintf _vsnprintf
|
#define vsnprintf _vsnprintf
|
||||||
#define strdup(x) _strdup(x)
|
#define strdup(x) _strdup(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#define PATH_MAX MAX_PATH
|
#define PATH_MAX MAX_PATH
|
||||||
#define MG_DIRSEP '\\'
|
#define MG_DIRSEP '\\'
|
||||||
|
|||||||
Reference in new issue
Block a user