File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,6 +113,14 @@ check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
113113check_include_file ("sys/types.h" HAVE_SYS_TYPES_H )
114114check_include_file ("unistd.h" HAVE_UNISTD_H )
115115
116+ # types.h depends on HAVE_LIMITS_H, and it is defined in options.h (rather than
117+ # config.h) so that applications consuming wolfSSL headers see it. The in-tree
118+ # build, however, is configured through config.h/compile definitions and does
119+ # not include options.h, so define it here as well.
120+ if (HAVE_LIMITS_H)
121+ add_definitions ("-DHAVE_LIMITS_H" )
122+ endif ()
123+
116124include (CheckFunctionExists )
117125
118126# TODO: Also check if these functions are declared by the
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ extern "C" {
3838#undef _POSIX_THREADS
3939#cmakedefine _POSIX_THREADS
4040#endif
41+ /* Since types.h depends on HAVE_LIMITS_H, we must define it in options.h. */
42+ #undef HAVE_LIMITS_H
43+ #cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
4144#undef ASIO_USE_WOLFSSL
4245#cmakedefine ASIO_USE_WOLFSSL
4346#undef BOOST_ASIO_USE_WOLFSSL
Original file line number Diff line number Diff line change 204204 fi
205205fi
206206
207- 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] )
207+ 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] )
208+ # Special case: Since types.h depends on HAVE_LIMITS_H, we must define it in options.h.
209+ AC_CHECK_HEADER ( [ limits.h] , [ AM_CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIMITS_H=1"] , [ ] )
208210AC_CHECK_LIB ( [ network] ,[ socket] )
209211AC_C_BIGENDIAN
210212AC_C___ATOMIC
Original file line number Diff line number Diff line change @@ -231,6 +231,15 @@ typedef const char wcchar[];
231231 (ULONG_MAX == 0xffffffffUL )
232232 #define SIZEOF_LONG 4
233233 #endif
234+ /* On LP64 (e.g. 64-bit Linux/macOS) long is 8 bytes. Detect it from the
235+ * target's own limits.h so CTC_SETTINGS matches the library, which gets
236+ * SIZEOF_LONG=8 from config.h. This must be derived per-target (not
237+ * baked into options.h), so LLP64 targets such as Windows correctly get
238+ * SIZEOF_LONG=4 from the branch above. */
239+ #if !defined(SIZEOF_LONG) && defined(ULONG_MAX) && \
240+ (ULONG_MAX == 0xffffffffffffffffULL )
241+ #define SIZEOF_LONG 8
242+ #endif
234243 #if !defined(SIZEOF_LONG_LONG) && defined(ULLONG_MAX) && \
235244 (ULLONG_MAX == 0xffffffffffffffffULL )
236245 #define SIZEOF_LONG_LONG 8
You can’t perform that action at this time.
0 commit comments