Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmake/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
/* Define to 1 if you have the `gmtime_r' function. */
#cmakedefine HAVE_GMTIME_R @HAVE_GMTIME_R@

/* Define to 1 if you have the <limits.h> header file. */
#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@

/* Define to 1 if you have the <pcap/pcap.h> header file. */
#cmakedefine HAVE_PCAP_PCAP_H @HAVE_PCAP_PCAP_H@

Expand Down
3 changes: 3 additions & 0 deletions cmake/options.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ extern "C" {
#endif

#ifndef WOLFSSL_OPTIONS_IGNORE_SYS
/* Since types.h depends on HAVE_LIMITS_H, we must define it in options.h. */
#undef HAVE_LIMITS_H
#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
Comment on lines 35 to +38
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the autotools-generated options.h, WOLFSSL_OPTIONS_IGNORE_SYS only gates macros that start with '_' (see configure.ac generation logic). Putting HAVE_LIMITS_H under this guard in the CMake options.h template means builds that define WOLFSSL_OPTIONS_IGNORE_SYS will not get HAVE_LIMITS_H, which can reintroduce the types.h sizing failure this PR is trying to fix. Consider moving HAVE_LIMITS_H outside the WOLFSSL_OPTIONS_IGNORE_SYS block (or otherwise aligning the gating behavior with configure’s options.h generation).

Suggested change
#ifndef WOLFSSL_OPTIONS_IGNORE_SYS
/* Since types.h depends on HAVE_LIMITS_H, we must define it in options.h. */
#undef HAVE_LIMITS_H
#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
/* Since types.h depends on HAVE_LIMITS_H, we must define it in options.h. */
#undef HAVE_LIMITS_H
#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
#ifndef WOLFSSL_OPTIONS_IGNORE_SYS

Copilot uses AI. Check for mistakes.
#undef _GNU_SOURCE
#cmakedefine _GNU_SOURCE
#undef _POSIX_THREADS
Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ AC_ARG_ENABLE([freebsdkm-crypto-register],
[ENABLED_BSDKM_REGISTER=no]
)

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])
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])
# Special case: Since types.h depends on HAVE_LIMITS_H, we must define it in options.h.
AC_CHECK_HEADER([limits.h], [AM_CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIMITS_H=1"], [])
AC_CHECK_LIB([network],[socket])
AC_C_BIGENDIAN
AC_C___ATOMIC
Expand Down
Loading