gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 02/08: Test for stdlib.h presence


From: gnunet
Subject: [libmicrohttpd] 02/08: Test for stdlib.h presence
Date: Wed, 01 Sep 2021 10:23:35 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit a64a0ac77ee5dcfa40c727c53f86fe9c62ff12be
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed Sep 1 10:19:16 2021 +0300

    Test for stdlib.h presence
---
 configure.ac                  | 2 +-
 src/include/platform.h        | 2 ++
 src/microhttpd/memorypool.c   | 2 ++
 src/microhttpd/mhd_compat.h   | 2 ++
 src/microhttpd/mhd_itc.h      | 4 +++-
 src/microhttpd/mhd_locks.h    | 4 +++-
 src/microhttpd/mhd_threads.c  | 2 ++
 src/microhttpd/mhd_threads.h  | 6 ++++--
 src/microhttpd/sysfdsetsize.c | 2 ++
 src/microhttpd/tsearch.c      | 2 ++
 10 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6478b67c..a332fca5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1057,7 +1057,7 @@ AC_CHECK_HEADERS([sys/types.h sys/time.h sys/msg.h time.h 
sys/mman.h sys/ioctl.h
   sys/socket.h sys/select.h netdb.h netinet/in.h netinet/ip.h netinet/tcp.h 
arpa/inet.h \
   endian.h machine/endian.h sys/endian.h sys/param.h sys/machine.h 
sys/byteorder.h machine/param.h sys/isa_defs.h \
   signal.h \
-  inttypes.h stddef.h unistd.h \
+  inttypes.h stddef.h stdlib.h unistd.h \
   sockLib.h inetLib.h net/if.h], [], [], [AC_INCLUDES_DEFAULT])
 
 AC_CHECK_HEADER([[search.h]],
diff --git a/src/include/platform.h b/src/include/platform.h
index 05fe1cd4..716f23ab 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -37,7 +37,9 @@
 #include "mhd_options.h"
 
 #include <stdio.h>
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
 #include <stdint.h>
 #include <string.h>
 #ifdef HAVE_UNISTD_H
diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c
index adda0e98..f6883b08 100644
--- a/src/microhttpd/memorypool.c
+++ b/src/microhttpd/memorypool.c
@@ -25,7 +25,9 @@
  * @author Karlson2k (Evgeny Grin)
  */
 #include "memorypool.h"
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
 #include <string.h>
 #include <stdint.h>
 #include "mhd_assert.h"
diff --git a/src/microhttpd/mhd_compat.h b/src/microhttpd/mhd_compat.h
index 4062c101..37b9744d 100644
--- a/src/microhttpd/mhd_compat.h
+++ b/src/microhttpd/mhd_compat.h
@@ -35,7 +35,9 @@
 #define MHD_COMPAT_H 1
 
 #include "mhd_options.h"
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
 #ifdef HAVE_STRING_H /* for strerror() */
 #include <string.h>
 #endif /* HAVE_STRING_H */
diff --git a/src/microhttpd/mhd_itc.h b/src/microhttpd/mhd_itc.h
index a7cad0e1..27b36392 100644
--- a/src/microhttpd/mhd_itc.h
+++ b/src/microhttpd/mhd_itc.h
@@ -38,7 +38,9 @@
 
 #ifndef MHD_PANIC
 #  include <stdio.h>
-#  include <stdlib.h>
+#  ifdef HAVE_STDLIB_H
+#    include <stdlib.h>
+#  endif /* HAVE_STDLIB_H */
 /* Simple implementation of MHD_PANIC, to be used outside lib */
 #  define MHD_PANIC(msg) do { fprintf (stderr,           \
                                        "Abnormal termination at %d line in 
file %s: %s\n", \
diff --git a/src/microhttpd/mhd_locks.h b/src/microhttpd/mhd_locks.h
index 2ef7747e..654ecb6c 100644
--- a/src/microhttpd/mhd_locks.h
+++ b/src/microhttpd/mhd_locks.h
@@ -58,7 +58,9 @@
 
 #ifndef MHD_PANIC
 #  include <stdio.h>
-#  include <stdlib.h>
+#  ifdef HAVE_STDLIB_H
+#    include <stdlib.h>
+#  endif /* HAVE_STDLIB_H */
 /* Simple implementation of MHD_PANIC, to be used outside lib */
 #  define MHD_PANIC(msg) do { fprintf (stderr,           \
                                        "Abnormal termination at %d line in 
file %s: %s\n", \
diff --git a/src/microhttpd/mhd_threads.c b/src/microhttpd/mhd_threads.c
index 3a63cff1..52aba875 100644
--- a/src/microhttpd/mhd_threads.c
+++ b/src/microhttpd/mhd_threads.c
@@ -30,7 +30,9 @@
 #include <process.h>
 #endif
 #ifdef MHD_USE_THREAD_NAME_
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
 #ifdef HAVE_PTHREAD_NP_H
 #include <pthread_np.h>
 #endif /* HAVE_PTHREAD_NP_H */
diff --git a/src/microhttpd/mhd_threads.h b/src/microhttpd/mhd_threads.h
index dcc7b09a..14612ded 100644
--- a/src/microhttpd/mhd_threads.h
+++ b/src/microhttpd/mhd_threads.h
@@ -39,9 +39,11 @@
 #include "mhd_options.h"
 #ifdef HAVE_STDDEF_H
 #  include <stddef.h> /* for size_t */
-#else  /* ! HAVE_STDDEF_H */
+#elif defined(HAVE_STDLIB_H)
 #  include <stdlib.h> /* for size_t */
-#endif /* ! HAVE_STDDEF_H */
+#else /* ! HAVE_STDLIB_H */
+#  include <stdio.h>  /* for size_t */
+#endif /* ! HAVE_STDLIB_H */
 
 #if defined(MHD_USE_POSIX_THREADS)
 #  undef HAVE_CONFIG_H
diff --git a/src/microhttpd/sysfdsetsize.c b/src/microhttpd/sysfdsetsize.c
index 4929b3d2..8268e274 100644
--- a/src/microhttpd/sysfdsetsize.c
+++ b/src/microhttpd/sysfdsetsize.c
@@ -33,7 +33,9 @@
 #undef FD_SETSIZE
 #endif /* FD_SETSIZE */
 
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
 #if defined(__VXWORKS__) || defined(__vxworks) || defined(OS_VXWORKS)
 #include <sockLib.h>
 #endif /* OS_VXWORKS */
diff --git a/src/microhttpd/tsearch.c b/src/microhttpd/tsearch.c
index 1d74dcce..971ec276 100644
--- a/src/microhttpd/tsearch.c
+++ b/src/microhttpd/tsearch.c
@@ -10,7 +10,9 @@
  */
 
 #include "tsearch.h"
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
 
 
 typedef struct node

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]