Peter Kokot [Sun, 16 Sep 2018 17:16:47 +0000 (19:16 +0200)]
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 `<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.
Peter Kokot [Sun, 16 Sep 2018 00:49:27 +0000 (02:49 +0200)]
Remove HAVE_PROTOTYPES and HAVE_STDARG_PROTOTYPES
The C89 standard and later defines the `<stdarg.h>` header as part of
the standard headers [1] and on current systems it is always present.
Checking for presence and functionality of the `<stdarg.h>` header and
variadic functions is not relevant anymore on current systems since this
is always available.
Also Autoconf suggests doing this and relying on C89 or above [2] and [3].
As an alternative, outdated versions of POSIX defined the legacy header
`<varargs.h>` [4].
This patch modernize the `<stdarg.h>` usage a bit.
Unused internal macro `va_init_list()` has been replaced with
`va_start()`.
Checking if functions support prototypes is also not relevant anymore
so the `HAVE_PROTOTYPES` symbol has been removed likewise.
Peter Kokot [Fri, 7 Sep 2018 18:30:02 +0000 (20:30 +0200)]
Remove obsolescent AC_HEADER_STDC
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_STDC`.
This macro checks if given system has C89 compliant header files such
as <string.h>, <stdlib.h>, <stdarg.h>, <float.h>,... and defines the
`STDC_HEADERS` symbol [2]. Case is that current systems should be well
supported with at least C89 standard headers [3].
Given headers are still additionally checked with the `AC_PROG_CC`
macro, yet not needed anyway.
For cmake build system this applies similarly and the manual custom
check of the standard headers can be removed likewise.
since they aren't used in the current Oniguruma code base. They were
originally mostly part of the build system files where they were defined
based on the system and the presence of the functions strcasecmp,
strncasecmp, strftime, strtod, strtol, strtoul, fmod, cosh, tanh, sinh,
frexp, mktime, modf. Since these functions aren't used in the code the
symbols for checking them can be also removed.
The `HAVE_TZNAME` was part of the AC_STRUCT_TIMEZONE from Autoconf and
other build system parts that checks if struct `tm` has a `tm_zone `
member. This is also not used in the current code base so can be removed.
Peter Kokot [Thu, 6 Sep 2018 09:54:49 +0000 (11:54 +0200)]
Remove HAVE_STRING_H
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].
Peter Kokot [Thu, 6 Sep 2018 05:49:18 +0000 (07:49 +0200)]
Upgrade deprecated AC_OUTPUT macro call
Autoconf 2.50 made several changes to macro calls. These include also
arguments passed to AC_OUTPUT macro. The upgrading chapter in Autoconf
documentation includes an example of using AC_OUTPUT with
AC_CONFIG_FILES and AC_CONFIG_COMMANDS:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
Systems out there should be well supported by now.
This patch was created with the help of autoupdate script:
autoupdate <file>
More info on where exactly this got deprecated:
- ftp://ftp.gnu.org/old-gnu/Manuals/autoconf-2.13/html_mono/autoconf.html
- ftp://ftp.auckland.ac.nz/pub/gnu/Manuals/autoconf-2.52/html_chapter/autoconf_15.html
- http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
Peter Kokot [Thu, 6 Sep 2018 04:00:14 +0000 (06:00 +0200)]
Remove AC_C_CONST
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems, including the `AC_C_CONST`.
The `const` keyword is used in C since C89. On old systems some compilers
lacked the `const` and this macro defined it to be empty. This check was
relevant on systems with compilers before C89 and on current systems it
can be omitted since ˙const` is always available. [2]
Peter Kokot [Thu, 6 Sep 2018 03:40:25 +0000 (05:40 +0200)]
Remove AC_HEADER_TIME
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_TIME`.
This macro checks if both `<sys/time.h>` and `<time.h>` can be included
at the same time and defines the `TIME_WITH_SYS_TIME` and
`HAVE_SYS_TIME_H` symbols. On current system such check is not relevant
anymore because in case both headers are present both can be also
included at the same time.
Peter Kokot [Thu, 6 Sep 2018 03:07:37 +0000 (05:07 +0200)]
Remove unused old symbols for string.h functions
The C89 standard and later defines the <string.h> header as part of the
standard headers [1]. Functions memcmp, memmove, strerror, strchr, strstr,
and others are all part of C89 and <string.h> header definition.
Some build systems used to define the presence of these functions via
HAVE_MEMCMP, HAVE_MEMMOVE, HAVE_STRERROR, HAVE_STRCHR, HAVE_STRSTR
symbols. These aren't used in oniguruma library anymore and can be
ommitted from the config files for windows systems.
Peter Kokot [Thu, 6 Sep 2018 02:45:45 +0000 (04:45 +0200)]
Remove AC_FUNC_MEMCMP
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_FUNC_MEMCMP`.
On some old systems such as SunOS 4.1.3 (EOL in 2003) and NeXT x86
OpenStep (discontinued) the `memcmp` function wasn't present or it
didn't work properly. [2]
On current systems including at least Solaris 10+ this check is not
relevant anymore.
Peter Kokot [Wed, 5 Sep 2018 03:42:32 +0000 (05:42 +0200)]
Remove HAVE_STDLIB_H
The `<stdlib.h>` header file is part of the standard C89 headers [1] and
on current systems there is no need to do a manual check if header is
present anymore [2].
Build systems used to check for the presence of the header file and defined
the `HAVE_STDLIB_H` symbol:
- Autoconf in configure.ac
- Cmake in CMakeLists.txt
This patch removes these checks and prepares for another patch to remove
the obsolescent `AC_HEADER_STDC` Autoconf macro and the obsolescent
`STDC_HEADERS` symbol.
Peter Kokot [Wed, 5 Sep 2018 02:25:01 +0000 (04:25 +0200)]
Remove HAVE_FLOAT_H
The `<float.h>` header file is part of the standard C89 headers [1] and
on current systems there is no need to do a manual check if header is
present anymore [2].
Build systems used to check for the presence of the header file and defined
the `HAVE_FLOAT_H` symbol.
Peter Kokot [Wed, 5 Sep 2018 00:05:32 +0000 (02:05 +0200)]
Remove HAVE_LIMITS_H
The `<limits.h>` header file is part of the standard C89 headers [1] and
on current systems there is no need to do a manual check anymore if
header is present.
Build systems checked for the presence of the header file and defined
the `HAVE_LIMITS_H` symbol:
- Autoconf in configure.a [2]
- cmake in CMakeLists.txt