From d5c2a64628c4a8731d69c92d816f39be0ab5f71a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 11 Jan 2023 09:42:18 +0000 Subject: Fix further strict C99 compliance issue. (fixes #37) PR: 66408 Submitted by: Sam James git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906594 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 20 ++++++++++++++++++++ configure.in | 9 ++++++--- poll/os2/pollset.c | 2 +- poll/unix/pollset.c | 2 +- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 2e446957e..ea5f37007 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -66,6 +66,12 @@ AC_DEFUN([APR_CHECK_WORKING_GETADDRINFO], [ #ifdef HAVE_STDLIB_H #include #endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif int main(void) { struct addrinfo hints, *ai; @@ -400,9 +406,11 @@ AC_DEFUN([APR_CHECK_TCP_NODELAY_INHERITED], [ AC_CACHE_CHECK(if TCP_NODELAY setting is inherited from listening sockets, ac_cv_tcp_nodelay_inherited,[ AC_TRY_RUN( [ #include +#include #ifdef HAVE_SYS_TYPES_H #include #endif +#include #ifdef HAVE_SYS_SOCKET_H #include #endif @@ -752,6 +760,12 @@ AC_TRY_COMPILE([ #ifdef HAVE_ARPA_INET_H #include #endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif ],[ inet_addr("127.0.0.1"); ],[ @@ -772,6 +786,10 @@ fi AC_DEFUN([APR_CHECK_INET_NETWORK], [ AC_CACHE_CHECK(for inet_network, ac_cv_func_inet_network,[ AC_TRY_COMPILE([ +#include +#ifdef HAVE_NETINET_IN_H +#include +#endif #ifdef HAVE_SYS_TYPES_H #include #endif @@ -958,7 +976,9 @@ AC_DEFUN([APR_CHECK_MCAST], [ AC_CACHE_CHECK([for struct ip_mreq], [apr_cv_struct_ipmreq], [ AC_TRY_COMPILE([ #include +#ifdef HAVE_NETINET_IN_H #include +#endif ], [ struct ip_mreq mip; mip.imr_interface.s_addr = INADDR_ANY; diff --git a/configure.in b/configure.in index 653d2597b..ab3f27db0 100644 --- a/configure.in +++ b/configure.in @@ -1477,8 +1477,6 @@ AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_DECL_SYS_SIGLIST AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) -APR_CHECK_INET_ADDR -APR_CHECK_INET_NETWORK AC_SUBST(apr_inaddr_none) AC_CHECK_FUNC(_getch) AC_CHECK_FUNCS(strerror_r, [ strerror_r="1" ], [ strerror_r="0" ]) @@ -1601,6 +1599,9 @@ else mswsockh=0 fi +APR_CHECK_INET_ADDR +APR_CHECK_INET_NETWORK + # IRIX 6.5 has a problem in which prevents it from # being included by itself. Check for manually, # including another header file first. @@ -2355,7 +2356,7 @@ AC_TRY_RUN([ #ifndef SEM_FAILED #define SEM_FAILED (-1) #endif -main() +int main() { sem_t *psem; const char *sem_name = "/apr_autoconf"; @@ -2552,6 +2553,8 @@ int fd; struct flock proc_mutex_lock_it = {0}; const char *fname = "conftest.fcntl"; +int lockit(); + int main() { int rc, status;; diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index 8c7a4b130..ba63a8cc3 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -308,7 +308,7 @@ APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) -APR_DECLARE(const char *) apr_poll_method_defname() +APR_DECLARE(const char *) apr_poll_method_defname(void) { return "select"; } diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 8db5ef0e4..89b038716 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -198,7 +198,7 @@ APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset) return pollset->provider->name; } -APR_DECLARE(const char *) apr_poll_method_defname() +APR_DECLARE(const char *) apr_poll_method_defname(void) { const apr_pollset_provider_t *provider = NULL; -- cgit v1.2.1