From e098a7292d1c7d1278002d84ebf345761564a120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandro=20S=C3=A1nchez=20Bach?= Date: Thu, 30 Oct 2014 23:07:48 +0100 Subject: [PATCH 1/2] Added #define's for deprecated POSIX names --- mongoose.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mongoose.c b/mongoose.c index 84c2d609..0e5f283a 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1247,10 +1247,15 @@ void ns_mgr_free(struct ns_mgr *s) { #define fopen(x, y) mg_fopen((x), (y)) #define open(x, y, z) mg_open((x), (y), (z)) #define close(x) _close(x) +#define fileno(x) _fileno(x) #define lseek(x, y, z) _lseeki64((x), (y), (z)) +#define read(x, y, z) _read((x), (y), (z)) +#define write(x, y, z) _write((x), (y), (z)) #define popen(x, y) _popen((x), (y)) #define pclose(x) _pclose(x) #define mkdir(x, y) _mkdir(x) +#define rmdir(x) _rmdir(x) +#define strdup(x) _strdup(x) #ifndef __func__ #define STRX(x) #x #define STR(x) STRX(x) From 9786478a31bf94d2efcb0bd988cd40b600dee16d Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Fri, 7 Nov 2014 10:41:48 +0200 Subject: [PATCH 2/2] Conditionally include dirent.h and dlfcn.h If you do not have a filesystem or do not support dav or dynamic loading, the corresponding header files need not be included (some environments might not have them). --- mongoose.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mongoose.c b/mongoose.c index 0e5f283a..e56dc669 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1274,8 +1274,13 @@ typedef HANDLE process_id_t; #else ////////////// UNIX specific defines and includes +#if !defined(MONGOOSE_NO_FILESYSTEM) &&\ + (!defined(MONGOOSE_NO_DAV) || !defined(MONGOOSE_NO_DIRECTORY_LISTING)) #include +#endif +#if !defined(MONGOOSE_NO_FILESYSTEM) && !defined(MONGOOSE_NO_DL) #include +#endif #include #include #define O_BINARY 0