]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Only include strings.h in MinGW builds
authorEli Zaretskii <eliz@gnu.org>
Sun, 9 Oct 2016 13:09:52 +0000 (16:09 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sun, 9 Oct 2016 13:09:52 +0000 (16:09 +0300)
* 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
job.c
main.c

index 450be4fb782a2ab1584103607b061234b2652353..117ea4abed746b6a41e1f93011cab1cf957e1d97 100644 (file)
@@ -268,7 +268,9 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #define HAVE_STRICMP 1
 
 /* Define to 1 if you have the <strings.h> header file. */
+#ifdef __MINGW32__
 #define HAVE_STRINGS_H 1
+#endif
 
 /* Define to 1 if you have the <string.h> header file. */
 #define HAVE_STRING_H 1
diff --git a/job.c b/job.c
index 4da0244ce80e1a3bd444c3cb5b8e64c4295e81cb..c2ecf1f9ad5616f4154c5fddded09986aba3047b 100644 (file)
--- a/job.c
+++ b/job.c
@@ -29,7 +29,9 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Default shell to use.  */
 #ifdef WINDOWS32
+#ifdef HAVE_STRINGS_H
 #include <strings.h>   /* for strcasecmp, strncasecmp */
+#endif
 #include <windows.h>
 
 const char *default_shell = "sh.exe";
diff --git a/main.c b/main.c
index a1703edc5e842b597b2b6b52fdc446de52c3e036..d5e8b04d3a3ccd61179ee682f951ad3e8799c69a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -33,7 +33,9 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #ifdef WINDOWS32
 # include <windows.h>
 # include <io.h>
+#ifdef HAVE_STRINGS_H
 # include <strings.h>  /* for strcasecmp */
+#endif
 # include "pathstuff.h"
 # include "sub_proc.h"
 # include "w32err.h"