summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2018-09-06 16:24:45 +0200
committerMike Frysinger <vapier@gmail.com>2018-09-08 03:29:27 -0400
commit5dc2dd8b49520c9c8a59798a03553a7e88d94072 (patch)
tree298c7f23a0e75e31825165f78adf5a7681143235
parentd8ead0b8e0470a70f4d67fbc391b24471cdd405a (diff)
downloadlibgd-5dc2dd8b49520c9c8a59798a03553a7e88d94072.tar.gz
Remove HAVE_STDLIB_H
The C89 and later standard defines the `<stdlib.h>` header as part of the standard headers [1] and on current systems it is always present and the `HAVE_STDLIB_H` symbol can be removed. 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
-rw-r--r--VMS/CONFIGURE.COM3
-rw-r--r--cmake/modules/AC_HEADER_STDC.cmake1
-rw-r--r--configure.ac1
-rw-r--r--src/config.h.cmake3
-rw-r--r--src/gd_jpeg.c5
-rw-r--r--src/webpng.c2
-rw-r--r--windows/msys/Makefile2
7 files changed, 1 insertions, 16 deletions
diff --git a/VMS/CONFIGURE.COM b/VMS/CONFIGURE.COM
index 178b51b..f2679d6 100644
--- a/VMS/CONFIGURE.COM
+++ b/VMS/CONFIGURE.COM
@@ -899,9 +899,6 @@ $COPY SYS$INPUT [.SRC]CONFIG.H
/* Define to 1 if you have the <stdint.h> header file. */
//#define HAVE_STDINT_H 1
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
diff --git a/cmake/modules/AC_HEADER_STDC.cmake b/cmake/modules/AC_HEADER_STDC.cmake
index 17e2789..fafc76b 100644
--- a/cmake/modules/AC_HEADER_STDC.cmake
+++ b/cmake/modules/AC_HEADER_STDC.cmake
@@ -3,7 +3,6 @@
check_include_files(dirent.h HAVE_DIRENT_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_include_files(stdint.h HAVE_STDINT_H)
-check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(unistd.h HAVE_UNISTD_H)
diff --git a/configure.ac b/configure.ac
index eb69a45..890c36e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,7 +62,6 @@ AC_CHECK_HEADERS_ONCE(m4_flatten([
dirent.h
inttypes.h
stdint.h
- stdlib.h
strings.h
unistd.h
sys/stat.h
diff --git a/src/config.h.cmake b/src/config.h.cmake
index 8b6c0b9..54f3a52 100644
--- a/src/config.h.cmake
+++ b/src/config.h.cmake
@@ -75,9 +75,6 @@
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H
-/* Define to 1 if you have the <stdlib.h> header file. */
-#cmakedefine HAVE_STDLIB_H
-
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H
diff --git a/src/gd_jpeg.c b/src/gd_jpeg.c
index b5368ea..fc05842 100644
--- a/src/gd_jpeg.c
+++ b/src/gd_jpeg.c
@@ -47,11 +47,6 @@
# define HAVE_BOOLEAN
#endif
-/* JCE undef symbols that we don't need anymore but which are
- may be defined in config.h from ./configure but which are
- redefined incompatibly in jpeglib.h */
-#undef HAVE_STDLIB_H
-
/* 1.8.1: remove dependency on jinclude.h */
#include "jpeglib.h"
#include "jerror.h"
diff --git a/src/webpng.c b/src/webpng.c
index a19750a..b376253 100644
--- a/src/webpng.c
+++ b/src/webpng.c
@@ -6,9 +6,7 @@
#include <stdarg.h>
#include <errno.h>
#include <stdio.h>
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/windows/msys/Makefile b/windows/msys/Makefile
index e5bfb18..f572fbe 100644
--- a/windows/msys/Makefile
+++ b/windows/msys/Makefile
@@ -9,7 +9,7 @@ LIBVER=3.0.1
# Misc. config flags.
CDEFS=-DHAVE_ICONV -DHAVE_ICONV_H \
-DHAVE_ICONV_T_DEF -DHAVE_INTTYPES_H \
--DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_VISIBILITY -DICONV_CONST
+-DHAVE_STDINT_H -DHAVE_VISIBILITY -DICONV_CONST
# GnuWin32 libs should all be installed in one place.
GNUDIR=/c/tools/GnuWin32