From 9786478a31bf94d2efcb0bd988cd40b600dee16d Mon Sep 17 00:00:00 2001 From: Johan Wikman <johan.wikman@nokia.com> Date: Fri, 7 Nov 2014 10:41:48 +0200 Subject: [PATCH] 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 0e5f283a5..e56dc6691 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 <dirent.h> +#endif +#if !defined(MONGOOSE_NO_FILESYSTEM) && !defined(MONGOOSE_NO_DL) #include <dlfcn.h> +#endif #include <inttypes.h> #include <pwd.h> #define O_BINARY 0 -- GitLab