From 7ed37f0166b6478837e1a02b8d7ed18fdb85c95e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 9 Oct 2016 16:09:52 +0300 Subject: [PATCH] Only include strings.h in MinGW builds * main.c: * job.c: Include strings.h only if HAVE_STRINGS_H is defined. * config.h.W32.template (HAVE_STRINGS_H): Define only for MinGW, as MSVC doesn't have this header. --- config.h.W32.template | 2 ++ job.c | 2 ++ main.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/config.h.W32.template b/config.h.W32.template index 450be4fb..117ea4ab 100644 --- a/config.h.W32.template +++ b/config.h.W32.template @@ -268,7 +268,9 @@ this program. If not, see . */ #define HAVE_STRICMP 1 /* Define to 1 if you have the header file. */ +#ifdef __MINGW32__ #define HAVE_STRINGS_H 1 +#endif /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 diff --git a/job.c b/job.c index 4da0244c..c2ecf1f9 100644 --- a/job.c +++ b/job.c @@ -29,7 +29,9 @@ this program. If not, see . */ /* Default shell to use. */ #ifdef WINDOWS32 +#ifdef HAVE_STRINGS_H #include /* for strcasecmp, strncasecmp */ +#endif #include const char *default_shell = "sh.exe"; diff --git a/main.c b/main.c index a1703edc..d5e8b04d 100644 --- a/main.c +++ b/main.c @@ -33,7 +33,9 @@ this program. If not, see . */ #ifdef WINDOWS32 # include # include +#ifdef HAVE_STRINGS_H # include /* for strcasecmp */ +#endif # include "pathstuff.h" # include "sub_proc.h" # include "w32err.h"