From 0d28f99275b3a6a3e23924b9328da4b9d4d92fd7 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka <valenok@gmail.com> Date: Mon, 27 Jan 2014 11:12:43 +0000 Subject: [PATCH] wrapped pid_t and S_ISDIR definitions into ifndef for mingw build --- mongoose.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mongoose.c b/mongoose.c index 4f26359d3..1a596f475 100644 --- a/mongoose.c +++ b/mongoose.c @@ -51,7 +51,9 @@ #include <io.h> // For _lseeki64 #include <direct.h> // For _mkdir typedef int socklen_t; +#ifndef pid_t typedef HANDLE pid_t; +#endif typedef SOCKET sock_t; typedef unsigned char uint8_t; typedef unsigned int uint32_t; @@ -75,7 +77,9 @@ typedef struct _stati64 file_stat_t; #define mutex_lock(x) EnterCriticalSection(x) #define mutex_unlock(x) LeaveCriticalSection(x) #define get_thread_id() ((unsigned long) GetCurrentThreadId()) +#ifndef S_ISDIR #define S_ISDIR(x) ((x) & _S_IFDIR) +#endif #define sleep(x) Sleep((x) * 1000) #define stat(x, y) mg_stat((x), (y)) #define fopen(x, y) mg_fopen((x), (y)) -- GitLab