diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/BUILD2_AUTOCONF_LIBC_VERSION.h b/libbuild2-autoconf/libbuild2/autoconf/checks/BUILD2_AUTOCONF_LIBC_VERSION.h index dad33e0..a66074e 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/BUILD2_AUTOCONF_LIBC_VERSION.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/BUILD2_AUTOCONF_LIBC_VERSION.h @@ -32,11 +32,16 @@ * #if defined(__OpenBSD__) * #if defined(__NetBSD__) * - * Except for MacOS, which we detect using our own macro (for the sake of - * simplicity): + * Except for MacOS specifically, which we detect using our own macro (for + * the sake of simplicity): * * #if defined(BUILD2_AUTOCONF_MACOS) * + * If, however, you want to cover the entire Apple operation systems family, + * then use: + * + * #if defined(__APPLE__) + * * Macros for detecting platforms and their versions: * * __GLIBC__: The glibc major version number. diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/socklen_t.h b/libbuild2-autoconf/libbuild2/autoconf/checks/socklen_t.h index cef454d..c51a05e 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/socklen_t.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/socklen_t.h @@ -1,10 +1,9 @@ -// socklen_t : BUILD2_AUTOCONF_LIBC_VERSION +// socklen_t! -#ifndef BUILD2_AUTOCONF_LIBC_VERSION -# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included -#endif - -#undef socklen_t +/* If socklen_t is already defined, assume it's correct and use it as-is (see + * ssize_t for details). + */ +#ifndef socklen_t /* Since 4.xBSD, SunOS * The Single UNIX Specification, Version 2 @@ -13,19 +12,20 @@ * To forestall portability problems, it is recommended that * applications should not use values larger than 232 - 1. */ -#if defined(__linux__) || \ - defined(__FreeBSD__) || \ - defined(__OpenBSD__) || \ - defined(__NetBSD__) || \ - defined(BUILD2_AUTOCONF_MACOS) || \ - (defined(__sun) && defined(__SVR4)) || \ - defined(__CYGWIN__) -# include - /* If available, we do nothing. */ -#elif defined(_WIN32) -# include - /* If available, we do nothing. */ -#else - /* Else define it to unsigned int (suggested fallback by libevent). */ -# define socklen_t unsigned int +# if defined(__linux__) || \ + defined(__FreeBSD__) || \ + defined(__OpenBSD__) || \ + defined(__NetBSD__) || \ + defined(__APPLE__) || \ + (defined(__sun) && defined(__SVR4)) || \ + defined(__CYGWIN__) +# include + /* If available, we do nothing. */ +# elif defined(_WIN32) +# include + /* If available, we do nothing. */ +# else + /* Else define it to unsigned int (suggested fallback by libevent). */ +# define socklen_t unsigned int +# endif #endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/ssize_t.h b/libbuild2-autoconf/libbuild2/autoconf/checks/ssize_t.h index 2d18f6d..eb57536 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/ssize_t.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/ssize_t.h @@ -1,28 +1,30 @@ -// ssize_t : BUILD2_AUTOCONF_LIBC_VERSION +// ssize_t! -#ifndef BUILD2_AUTOCONF_LIBC_VERSION -# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included -#endif - -#undef ssize_t - -/* POSIX and MinGW (which also has that defines ssize_t). +/* If ssize_t is already defined, assume it's correct and use it as-is. + * + * Note that we may not be able to redefine it because while we can undef the + * macro, there is no guarantee we will be able to re-include the header (due + * to include guards). */ -#if defined(__linux__) || \ - defined(__FreeBSD__) || \ - defined(__OpenBSD__) || \ - defined(__NetBSD__) || \ - defined(BUILD2_AUTOCONF_MACOS) || \ - defined(__MINGW32__) || \ - (defined(__sun) && defined(__SVR4)) || \ - defined(__CYGWIN__) -# include - /* If available, we do nothing. */ -#elif defined(_WIN32) -# include - /* Use define instead of typedef to avoid conflicts. */ -# define ssize_t SSIZE_T -#else - /* Else define it to int (suggested fallback by libevent). */ -# define ssize_t int +#ifndef ssize_t + /* POSIX and MinGW (which also has that defines ssize_t). + */ +# if defined(__linux__) || \ + defined(__FreeBSD__) || \ + defined(__OpenBSD__) || \ + defined(__NetBSD__) || \ + defined(__APPLE__) || \ + defined(__MINGW32__) || \ + (defined(__sun) && defined(__SVR4)) || \ + defined(__CYGWIN__) +# include + /* If available, we do nothing. */ +# elif defined(_WIN32) +# include + /* Use define instead of typedef to avoid conflicts. */ +# define ssize_t SSIZE_T +# else + /* Else define it to int (suggested fallback by libevent). */ +# define ssize_t int +# endif #endif