From 46029c501a81d429f5a21e979519d8cc37e0567a Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Mon, 27 Sep 2021 13:52:39 +0100 Subject: [PATCH] Fix #1359 - add conditional for MSVC, _DEBUG and strdup --- mongoose.h | 2 ++ src/arch_win32.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mongoose.h b/mongoose.h index 0ae3de3b..53821660 100644 --- a/mongoose.h +++ b/mongoose.h @@ -418,8 +418,10 @@ typedef enum { false = 0, true = 1 } bool; #ifndef __cplusplus #define snprintf _snprintf #define vsnprintf _vsnprintf +#ifndef strdup // For MSVC with _DEBUG, see #1359 #define strdup(x) _strdup(x) #endif +#endif typedef unsigned suseconds_t; typedef int socklen_t; diff --git a/src/arch_win32.h b/src/arch_win32.h index a14343f0..a9183227 100644 --- a/src/arch_win32.h +++ b/src/arch_win32.h @@ -51,8 +51,10 @@ typedef enum { false = 0, true = 1 } bool; #ifndef __cplusplus #define snprintf _snprintf #define vsnprintf _vsnprintf +#ifndef strdup // For MSVC with _DEBUG, see #1359 #define strdup(x) _strdup(x) #endif +#endif typedef unsigned suseconds_t; typedef int socklen_t;