Skip to content

Commit 4887907

Browse files
committed
Allow for older macOS versions that might not have 10.12 macros defined.
1 parent 9c0b0d2 commit 4887907

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/pylifecycle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# include <mach-o/loader.h>
5050
// The os_log unified logging APIs were introduced in macOS 10.12, iOS 10.0,
5151
// tvOS 10.0, and watchOS 3.0;
52-
# if TARGET_OS_IPHONE || (TARGET_OS_OSX && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)
52+
# if TARGET_OS_IPHONE || (TARGET_OS_OSX && defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)
5353
# include <os/log.h>
5454
# endif
5555
#endif
@@ -2964,7 +2964,7 @@ apple_log_write_impl(PyObject *self, PyObject *args)
29642964
// Call the underlying Apple logging API. The os_log unified logging APIs
29652965
// were introduced in macOS 10.12, iOS 10.0, tvOS 10.0, and watchOS 3.0;
29662966
// this call is a no-op on older versions.
2967-
#if TARGET_OS_IPHONE || (TARGET_OS_OSX && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)
2967+
#if TARGET_OS_IPHONE || (TARGET_OS_OSX && defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)
29682968
// Pass the user-provided text through explicit %s formatting
29692969
// to avoid % literals being interpreted as a formatting directive.
29702970
os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);

0 commit comments

Comments
 (0)