From: Peter Kokot Date: Sun, 16 Sep 2018 17:16:47 +0000 (+0200) Subject: Remove HAVE_STRINGS_H X-Git-Tag: v6.9.1~23^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17af94f8490fc0a7b813aff6a179f06107dbe32d;p=onig Remove HAVE_STRINGS_H 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 `` [1] header file included as none of the functions defined by it are used: * ffs * strcasecmp * strcasecmp_l * strncasecmp * strncasecmp_l and the `` 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 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 093b6a5..cfec42c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/configure.ac b/configure.ac index 2353fd7..e8055b0 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/src/config.h.cmake.in b/src/config.h.cmake.in index c8ea95c..f49177f 100644 --- a/src/config.h.cmake.in +++ b/src/config.h.cmake.in @@ -16,9 +16,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H} -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STRINGS_H ${HAVE_STRINGS_H} - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TIMES_H ${HAVE_SYS_TIMES_H} diff --git a/windows/testc.c b/windows/testc.c index e17842f..c15b0ea 100644 --- a/windows/testc.c +++ b/windows/testc.c @@ -12,11 +12,7 @@ #include "oniguruma.h" #endif -#ifdef _WIN32 -# include -#else -# include -#endif +#include #define SLEN(s) strlen(s)