Skip to content

Commit 8ea2611

Browse files
Define HAVE_LIMITS_H in options.h rather than config.h since types.h depends on this definition and config.h isn't consistently available at runtime.
Fixes #9936.
1 parent 64c4203 commit 8ea2611

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

cmake/config.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
/* Define to 1 if you have the `gmtime_r' function. */
2020
#cmakedefine HAVE_GMTIME_R @HAVE_GMTIME_R@
2121

22-
/* Define to 1 if you have the <limits.h> header file. */
23-
#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
24-
2522
/* Define to 1 if you have the <pcap/pcap.h> header file. */
2623
#cmakedefine HAVE_PCAP_PCAP_H @HAVE_PCAP_PCAP_H@
2724

cmake/options.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ extern "C" {
3333
#endif
3434

3535
#ifndef WOLFSSL_OPTIONS_IGNORE_SYS
36+
/* Since types.h depends on HAVE_LIMITS_H, we must define it in options.h. */
37+
#undef HAVE_LIMITS_H
38+
#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
3639
#undef _GNU_SOURCE
3740
#cmakedefine _GNU_SOURCE
3841
#undef _POSIX_THREADS

configure.ac

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ AC_ARG_ENABLE([freebsdkm-crypto-register],
184184
[ENABLED_BSDKM_REGISTER=no]
185185
)
186186

187-
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h time.h sys/ioctl.h sys/socket.h sys/time.h errno.h sys/un.h ctype.h sys/random.h])
187+
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stddef.h time.h sys/ioctl.h sys/socket.h sys/time.h errno.h sys/un.h ctype.h sys/random.h])
188+
# Special case: Since types.h depends on HAVE_LIMITS_H, we must define it in options.h.
189+
AC_CHECK_HEADER([limits.h], [AM_CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIMITS_H=1"], [])
188190
AC_CHECK_LIB([network],[socket])
189191
AC_C_BIGENDIAN
190192
AC_C___ATOMIC

0 commit comments

Comments
 (0)