]> granicus.if.org Git - onig/commitdiff
Remove HAVE_STRING_H
authorPeter Kokot <peterkokot@gmail.com>
Thu, 6 Sep 2018 09:54:49 +0000 (11:54 +0200)
committerPeter Kokot <peterkokot@gmail.com>
Thu, 6 Sep 2018 09:54:49 +0000 (11:54 +0200)
The C89 standard and later defines the <string.h> header as part of the
standard headers [1] and on current systems it is always present.

Code included also <strings.h> header as an alterinative in some files.
This kind of check was relevant on some older systems where the
<strings.h> file included definitions for the C89 compliant <string.h>.
Today such alternative check is not required anymore. The <strings.h>
file is part of the POSIX definition these days. Current code doesn't
require the <strings.h> files in cases of these patched files.

Also Autoconf suggests doing this and relying on C89 or above [2] and [3].

[1]: https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2]: http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3]: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html

CMakeLists.txt
configure.ac
src/config.h.cmake.in
src/config.h.win32
src/config.h.win64
src/config.h.windows.in
src/regint.h
src/regposerr.c
test/test_utf8.c
test/testc.c

index 4a4571bc725a33847cd3206be31c0d3cebc3c25b..323504f25bb2547b958b7be9eecb39b083e7a8ff 100644 (file)
@@ -37,7 +37,6 @@ set(HAVE_PROTOTYPES 1)
 check_include_files(stdarg.h    HAVE_STDARG_PROTOTYPES)
 check_include_files(stdint.h    HAVE_STDINT_H)
 check_include_files(strings.h   HAVE_STRINGS_H)
-check_include_files(string.h    HAVE_STRING_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 50486a92d936b590010b3debe6946bee41ed0969..fb72ed9035504fd7a67c8554a63a31954a39cb6b 100644 (file)
@@ -50,7 +50,7 @@ dnl Checks for libraries.
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(string.h strings.h sys/time.h unistd.h sys/times.h)
+AC_CHECK_HEADERS(strings.h sys/time.h unistd.h sys/times.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_CHECK_SIZEOF(int, 4)
index d51a7b7309b817ca7079f69e32975bbdb3677553..8c4ba109597fc5e99a4f932d2f6b4317df64b67a 100644 (file)
@@ -25,9 +25,6 @@
 /* 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 <string.h> header file. */
-#cmakedefine HAVE_STRING_H  ${HAVE_STRING_H}
-
 /* Define to 1 if you have the <sys/times.h> header file. */
 #cmakedefine HAVE_SYS_TIMES_H  ${HAVE_SYS_TIMES_H}
 
index f55d746f4a8929fb55653518fc7c39c09460a83c..36fe268d964f1d8afa6ddc3e6b4bed3956e2f355 100644 (file)
@@ -1,7 +1,6 @@
 #define STDC_HEADERS 1\r
 #define HAVE_SYS_TYPES_H 1\r
 #define HAVE_SYS_STAT_H 1\r
-#define HAVE_STRING_H 1\r
 #define HAVE_MEMORY_H 1\r
 #define HAVE_OFF_T 1\r
 #define SIZEOF_INT 4\r
@@ -25,7 +24,6 @@
 #endif\r
 #define HAVE_DECL_SYS_NERR 1\r
 #define STDC_HEADERS 1\r
-#define HAVE_STRING_H 1\r
 #define HAVE_FCNTL_H 1\r
 #define HAVE_SYS_UTIME_H 1\r
 #define HAVE_MEMORY_H 1\r
index ca1a53b4cb1a0cab46e680c7c6d6404fc3a3335b..bc2ba3e984c2dfa2a4d0bc8d94bdc88061390612 100644 (file)
@@ -1,7 +1,6 @@
 #define STDC_HEADERS 1\r
 #define HAVE_SYS_TYPES_H 1\r
 #define HAVE_SYS_STAT_H 1\r
-#define HAVE_STRING_H 1\r
 #define HAVE_MEMORY_H 1\r
 #define HAVE_OFF_T 1\r
 #define SIZEOF_INT 4\r
@@ -25,7 +24,6 @@
 #endif\r
 #define HAVE_DECL_SYS_NERR 1\r
 #define STDC_HEADERS 1\r
-#define HAVE_STRING_H 1\r
 #define HAVE_FCNTL_H 1\r
 #define HAVE_SYS_UTIME_H 1\r
 #define HAVE_MEMORY_H 1\r
index 2d5b84634f580e2b1b8682a82665e32d58abd881..160bd86f4bcdb190eeb8e2d1f8c22d7f8c1d29bf 100644 (file)
@@ -1,7 +1,6 @@
 #define STDC_HEADERS 1\r
 #define HAVE_SYS_TYPES_H 1\r
 #define HAVE_SYS_STAT_H 1\r
-#define HAVE_STRING_H 1\r
 #define HAVE_MEMORY_H 1\r
 #define HAVE_OFF_T 1\r
 #define SIZEOF_INT 4\r
@@ -29,7 +28,6 @@
 #endif\r
 #define HAVE_DECL_SYS_NERR 1\r
 #define STDC_HEADERS 1\r
-#define HAVE_STRING_H 1\r
 #define HAVE_FCNTL_H 1\r
 #define HAVE_SYS_UTIME_H 1\r
 #define HAVE_MEMORY_H 1\r
index 3d381a1dbd09f4ac6000b68a62b16c572482ecdb..cb7cd11eaef7f909ab8d6e93e4ce29d4a1879691 100644 (file)
 #include <alloca.h>
 #endif
 
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <string.h>
 
 #include <ctype.h>
 #ifdef HAVE_SYS_TYPES_H
index 2e2a8e22cf14ae5398bee87ec0d596cd97fd5f73..c640a8192cd58f71322828a0deed85492154e296 100644 (file)
 #include "config.h"
 #include "onigposix.h"
 
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <string.h>
 
 #if defined(__GNUC__)
 #  define ARG_UNUSED  __attribute__ ((unused))
index d5a966b6bb1d7bb11575dfb5a712568cafedfdb5..13a8830d5d28eea887f466d1ad02259636ea3b75 100644 (file)
@@ -9,11 +9,7 @@
 
 #include "oniguruma.h"
 
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <string.h>
 
 #define SLEN(s)  strlen(s)
 
index e37665a731fa1ac05f9514fa238662bc1c6e4b09..4aa8807a93f1378a4aa7cfdb9a5a796985f94639 100644 (file)
 #include "oniguruma.h"
 #endif
 
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <string.h>
 
 #define SLEN(s)  strlen(s)