Skip to content

Commit

Permalink
Merged revision(s) 22609 from trunk/OpenMPT:
Browse files Browse the repository at this point in the history
[Fix] mpt/base/source_location.hpp: Work-around missing std::source_location builtins in older Apple Clang versions. See <fink/fink-distributions#1202>.
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.30@22614 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Dec 26, 2024
1 parent bcfc05f commit c938b7e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mpt/base/source_location.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ using std::source_location;
#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()
Expand Down

0 comments on commit c938b7e

Please sign in to comment.