diff --git a/Source/cmStandardLexer.h b/Source/cmStandardLexer.h index fe69a86ee8..71e40d8ccf 100644 --- a/Source/cmStandardLexer.h +++ b/Source/cmStandardLexer.h @@ -23,6 +23,12 @@ // NOLINTNEXTLINE(bugprone-reserved-identifier) # define _XOPEN_SOURCE 700 #endif +#if defined(__APPLE__) +// Restore Darwin APIs removed by _POSIX_C_SOURCE: +// aligned_alloc +// NOLINTNEXTLINE(bugprone-reserved-identifier) +# define _DARWIN_C_SOURCE +#endif #include "cmsys/Configure.h" // IWYU pragma: keep diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index fdeff04a51..82fab531ca 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -11,6 +11,13 @@ // NOLINTNEXTLINE(bugprone-reserved-identifier) # define _XOPEN_SOURCE 700 #endif +#if defined(__APPLE__) +// Restore Darwin APIs removed by _POSIX_C_SOURCE: +// aligned_alloc +// timespec_get +// NOLINTNEXTLINE(bugprone-reserved-identifier) +# define _DARWIN_C_SOURCE +#endif #include "cmTimestamp.h"