From bad05485d0a5a8858fe2fdfa7c71dc44f986ae54 Mon Sep 17 00:00:00 2001 From: cpq Date: Tue, 23 May 2023 03:49:24 +0100 Subject: [PATCH] Define SIGPIPE for Win32, fix sleep() for Win32 --- mongoose.h | 6 +++++- src/arch_win32.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mongoose.h b/mongoose.h index b610185c..db184f97 100644 --- a/mongoose.h +++ b/mongoose.h @@ -468,7 +468,7 @@ typedef int socklen_t; (((errcode) < 0) && (WSAGetLastError() == WSAECONNRESET)) #define realpath(a, b) _fullpath((b), (a), MG_PATH_MAX) -#define sleep(x) Sleep(x) +#define sleep(x) Sleep((x) *1000) #define mkdir(a, b) _mkdir(a) #ifndef S_ISDIR @@ -479,6 +479,10 @@ typedef int socklen_t; #define MG_ENABLE_DIRLIST 1 #endif +#ifndef SIGPIPE +#define SIGPIPE 0 +#endif + #endif diff --git a/src/arch_win32.h b/src/arch_win32.h index 121d5c39..c4ed572c 100644 --- a/src/arch_win32.h +++ b/src/arch_win32.h @@ -94,7 +94,7 @@ typedef int socklen_t; (((errcode) < 0) && (WSAGetLastError() == WSAECONNRESET)) #define realpath(a, b) _fullpath((b), (a), MG_PATH_MAX) -#define sleep(x) Sleep(x) +#define sleep(x) Sleep((x) *1000) #define mkdir(a, b) _mkdir(a) #ifndef S_ISDIR @@ -105,4 +105,8 @@ typedef int socklen_t; #define MG_ENABLE_DIRLIST 1 #endif +#ifndef SIGPIPE +#define SIGPIPE 0 +#endif + #endif