Skip to content

Commit

Permalink
Allow for older macOS versions that might not have 10.12 macros defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Dec 22, 2024
1 parent 9c0b0d2 commit 4887907
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# include <mach-o/loader.h>
// The os_log unified logging APIs were introduced in macOS 10.12, iOS 10.0,
// tvOS 10.0, and watchOS 3.0;
# if TARGET_OS_IPHONE || (TARGET_OS_OSX && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)
# 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)
# include <os/log.h>
# endif
#endif
Expand Down Expand Up @@ -2964,7 +2964,7 @@ apple_log_write_impl(PyObject *self, PyObject *args)
// Call the underlying Apple logging API. The os_log unified logging APIs
// were introduced in macOS 10.12, iOS 10.0, tvOS 10.0, and watchOS 3.0;
// this call is a no-op on older versions.
#if TARGET_OS_IPHONE || (TARGET_OS_OSX && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)
#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)
// Pass the user-provided text through explicit %s formatting
// to avoid % literals being interpreted as a formatting directive.
os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
Expand Down

0 comments on commit 4887907

Please sign in to comment.