]> granicus.if.org Git - onig/commitdiff
Remove HAVE_STRINGS_H
authorPeter Kokot <peterkokot@gmail.com>
Sun, 16 Sep 2018 17:16:47 +0000 (19:16 +0200)
committerPeter Kokot <peterkokot@gmail.com>
Sun, 16 Sep 2018 17:16:47 +0000 (19:16 +0200)
This patch removes not needed `HAVE_STRINGS_H` symbol as was defined by
Autoconf in configure.ac and by CMake.

The windows/testc.c file also doesn't need the POSIX `<strings.h>` [1]
header file included as none of the functions defined by it are used:
* ffs
* strcasecmp
* strcasecmp_l
* strncasecmp
* strncasecmp_l

and the `<string.h>` file (part of C89 standard and above) [2] is
sufficient for it.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/strings.h.html
[2] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2

CMakeLists.txt
configure.ac
src/config.h.cmake.in
windows/testc.c

index 093b6a521b2ded34a062132f263050932a2b3b50..cfec42c8a0923110c54c76cd55c8fb65cd7514a2 100644 (file)
@@ -34,7 +34,6 @@ include(TestBigEndian)
 check_function_exists(alloca HAVE_ALLOCA)
 check_include_files(alloca.h HAVE_ALLOCA_H)
 check_include_files(stdint.h    HAVE_STDINT_H)
-check_include_files(strings.h   HAVE_STRINGS_H)
 check_include_files(sys/times.h HAVE_SYS_TIMES_H)
 check_include_files(sys/time.h  HAVE_SYS_TIME_H)
 check_include_files(sys/types.h HAVE_SYS_TYPES_H)
index 2353fd766573f7b5300682b79a560eba13dce62a..e8055b0abd2510c738237a8d6e30381cf1d7253c 100644 (file)
@@ -49,7 +49,7 @@ AC_PROG_MAKE_SET
 dnl Checks for libraries.
 
 dnl Checks for header files.
-AC_CHECK_HEADERS(strings.h sys/time.h unistd.h sys/times.h)
+AC_CHECK_HEADERS(sys/time.h unistd.h sys/times.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_CHECK_SIZEOF(int, 4)
index c8ea95c5aab0f0868876baf8b55a68053fce40d4..f49177f6768a4e02dc69ebefd0c8aa6c334fac1e 100644 (file)
@@ -16,9 +16,6 @@
 /* Define to 1 if you have the <stdint.h> header file. */
 #cmakedefine HAVE_STDINT_H  ${HAVE_STDINT_H}
 
-/* Define to 1 if you have the <strings.h> header file. */
-#cmakedefine HAVE_STRINGS_H  ${HAVE_STRINGS_H}
-
 /* Define to 1 if you have the <sys/times.h> header file. */
 #cmakedefine HAVE_SYS_TIMES_H  ${HAVE_SYS_TIMES_H}
 
index e17842fa6f75c8506b856d4c85bd4ddbee844892..c15b0eaa769522d7507b4ea3396e87c21d422089 100644 (file)
 #include "oniguruma.h"\r
 #endif\r
 \r
-#ifdef _WIN32\r
-# include <string.h>\r
-#else\r
-# include <strings.h>\r
-#endif\r
+#include <string.h>\r
 \r
 #define SLEN(s)  strlen(s)\r
 \r