File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,17 +148,6 @@ check_type_size("long" SIZEOF_LONG)
148148check_type_size ("time_t" SIZEOF_TIME_T )
149149check_type_size ("uintptr_t" HAVE_UINTPTR_T )
150150
151- # SIZEOF_LONG/SIZEOF_LONG_LONG are exposed to applications through options.h
152- # (see cmake/options.h.in) so that application code computes the same
153- # CTC_SETTINGS as the library. The in-tree build does not include options.h,
154- # so define them here for the library and test programs.
155- if (HAVE_SIZEOF_LONG)
156- add_definitions ("-DSIZEOF_LONG=${SIZEOF_LONG} " )
157- endif ()
158- if (HAVE_SIZEOF_LONG_LONG)
159- add_definitions ("-DSIZEOF_LONG_LONG=${SIZEOF_LONG_LONG} " )
160- endif ()
161-
162151# By default, HAVE___UINT128_T gets defined as TRUE,
163152# but we want it as 1.
164153if (HAVE___UINT128_T)
Original file line number Diff line number Diff line change 4949/* Define to the full name of this package. */
5050#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
5151
52+ /* The size of `long', as computed by sizeof. */
53+ #cmakedefine SIZEOF_LONG @SIZEOF_LONG@
54+
55+ /* The size of `long long', as computed by sizeof. */
56+ #cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
57+
5258/* The size of `time_t', as computed by sizeof. */
5359#cmakedefine SIZEOF_TIME_T @SIZEOF_TIME_T@
5460
Original file line number Diff line number Diff line change @@ -38,14 +38,9 @@ extern "C" {
3838#undef _POSIX_THREADS
3939#cmakedefine _POSIX_THREADS
4040#endif
41- /* Since types.h depends on HAVE_LIMITS_H, SIZEOF_LONG and SIZEOF_LONG_LONG,
42- * we must define them in options.h. */
41+ /* Since types.h depends on HAVE_LIMITS_H, we must define it in options.h. */
4342#undef HAVE_LIMITS_H
4443#cmakedefine HAVE_LIMITS_H @HAVE_LIMITS_H@
45- #undef SIZEOF_LONG
46- #cmakedefine SIZEOF_LONG @SIZEOF_LONG@
47- #undef SIZEOF_LONG_LONG
48- #cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
4944#undef ASIO_USE_WOLFSSL
5045#cmakedefine ASIO_USE_WOLFSSL
5146#undef BOOST_ASIO_USE_WOLFSSL
Original file line number Diff line number Diff line change 207207AC_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] )
208208# Special case: Since types.h depends on HAVE_LIMITS_H, we must define it in options.h.
209209AC_CHECK_HEADER ( [ limits.h] , [ AM_CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIMITS_H=1"] , [ ] )
210- # Propagate the measured integer sizes (from AC_CHECK_SIZEOF above) into
211- # options.h. The library obtains these from config.h, but config.h is not
212- # available to applications; without them, application code falls back to the
213- # limits.h/architecture heuristics in types.h and can compute a CTC_SETTINGS
214- # value that disagrees with the library's CheckRunTimeSettings().
215- AS_IF ( [ test "x$ac_cv_sizeof_long" != "x"] ,
216- [ AM_CPPFLAGS="$AM_CPPFLAGS -DSIZEOF_LONG=$ac_cv_sizeof_long"] )
217- AS_IF ( [ test "x$ac_cv_sizeof_long_long" != "x"] ,
218- [ AM_CPPFLAGS="$AM_CPPFLAGS -DSIZEOF_LONG_LONG=$ac_cv_sizeof_long_long"] )
219210AC_CHECK_LIB ( [ network] ,[ socket] )
220211AC_C_BIGENDIAN
221212AC_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