From: <sv...@op...> - 2024-12-26 19:16:40
|
Author: manx Date: Thu Dec 26 20:16:25 2024 New Revision: 22611 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22611 Log: Merged revision(s) 22609 from trunk/OpenMPT: [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: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/src/mpt/base/source_location.hpp Modified: branches/OpenMPT-1.31/src/mpt/base/source_location.hpp ============================================================================== --- branches/OpenMPT-1.31/src/mpt/base/source_location.hpp Thu Dec 26 20:16:02 2024 (r22610) +++ branches/OpenMPT-1.31/src/mpt/base/source_location.hpp Thu Dec 26 20:16:25 2024 (r22611) @@ -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() |