From: <sv...@op...> - 2024-12-26 19:14:57
|
Author: manx Date: Thu Dec 26 20:14:51 2024 New Revision: 22609 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22609 Log: [Fix] mpt/base/source_location.hpp: Work-around missing std::source_location builtins in older Apple Clang versions. See <https://github.com/fink/fink-distributions/issues/1202>. Modified: trunk/OpenMPT/src/mpt/base/source_location.hpp Modified: trunk/OpenMPT/src/mpt/base/source_location.hpp ============================================================================== --- trunk/OpenMPT/src/mpt/base/source_location.hpp Thu Dec 26 20:11:29 2024 (r22608) +++ trunk/OpenMPT/src/mpt/base/source_location.hpp Thu Dec 26 20:14:51 2024 (r22609) @@ -41,7 +41,11 @@ #define MPT_SOURCE_LOCATION_LINE __builtin_LINE() #define MPT_SOURCE_LOCATION_COLUMN 0 -#elif MPT_COMPILER_CLANG && MPT_CLANG_AT_LEAST(9, 0, 0) +#elif MPT_COMPILER_CLANG && ((!MPT_OS_MACOSX_OR_IOS && MPT_CLANG_AT_LEAST(9, 0, 0)) || (MPT_OS_MACOSX_OR_IOS && MPT_CLANG_AT_LEAST(12, 0, 0))) + +// We do not know which Apple Clang version introduced __builtin_FILE(). +// It fails with 10.x (see <https://github.com/fink/fink-distributions/issues/1202>), +// and IRC dicussion decided on 12.x as a somewhat safe choice. #define MPT_SOURCE_LOCATION_FILE __builtin_FILE() #define MPT_SOURCE_LOCATION_FUNCTION __builtin_FUNCTION() |