Add BUILD2_AUTOCONF_MACOS

This commit is contained in:
Francois Kritzinger 2022-05-26 16:55:06 +02:00
parent 7ae9db1cf1
commit 4c1a1bbff5
7 changed files with 30 additions and 10 deletions

View File

@ -31,9 +31,11 @@
* #if defined(__FreeBSD__)
* #if defined(__OpenBSD__)
* #if defined(__NetBSD__)
* #if defined(__APPLE__) && defined(__MACH__)
*
* Note that just __APPLE__ covers all the Apple platforms (MacOS, iOS, etc).
* Except for MacOS, which we detect using our own macro (for the sake of
* simplicity):
*
* #if defined(BUILD2_AUTOCONF_MACOS)
*
* Macros for detecting platforms and their versions:
*
@ -155,8 +157,16 @@
*
* Return 1 if the given version number is >= the Mac OS version, or 0
* otherwise.
*
* BUILD2_AUTOCONF_MACOS
*
* Defined if the current platform is MacOS, or undefined otherwise.
*/
#if defined(__APPLE__) && defined(__MACH__)
/* Note that just __APPLE__ covers all the Apple platforms (MacOS, iOS, etc).
*/
# define BUILD2_AUTOCONF_MACOS 1
# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
# error __MAC_OS_X_VERSION_MIN_REQUIRED not defined
# endif
@ -168,6 +178,8 @@
(__MAC_OS_X_VERSION_MIN_REQUIRED >= (maj)*10000 + (min)*100)
# endif
#else
# undef BUILD2_AUTOCONF_MACOS
# define BUILD2_AUTOCONF_MACOS_PREREQ(maj, min) 0
#endif

View File

@ -12,6 +12,6 @@
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \
(defined(__APPLE__) && defined(__MACH__))
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_DLOPEN 1
#endif

View File

@ -1,4 +1,8 @@
// HAVE_FCNTL_H
// HAVE_FCNTL_H : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_FCNTL_H
@ -6,6 +10,6 @@
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \
(defined(__APPLE__) && defined(__MACH__))
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_FCNTL_H 1
#endif

View File

@ -14,6 +14,6 @@
BUILD2_AUTOCONF_FREEBSD_PREREQ(3, 0) || \
BUILD2_AUTOCONF_OPENBSD_PREREQ(199610) || \
BUILD2_AUTOCONF_NETBSD_PREREQ(1, 2) || \
(defined(__APPLE__) && defined(__MACH__))
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_FUTIMES 1
#endif

View File

@ -14,6 +14,6 @@
BUILD2_AUTOCONF_FREEBSD_PREREQ(8, 0) || \
BUILD2_AUTOCONF_OPENBSD_PREREQ(201111) || \
BUILD2_AUTOCONF_NETBSD_PREREQ(7, 0) || \
(defined(__APPLE__) && defined(__MACH__))
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_LINKAT 1
#endif

View File

@ -14,6 +14,6 @@
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
BUILD2_AUTOCONF_NETBSD_PREREQ(1, 3) || \
(defined(__APPLE__) && defined(__MACH__))
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_POLL 1
#endif

View File

@ -1,4 +1,8 @@
// HAVE_UNISTD_H
// HAVE_UNISTD_H : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_UNISTD_H
@ -6,6 +10,6 @@
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \
(defined(__APPLE__) && defined(__MACH__))
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_UNISTD_H 1
#endif