Skip to content

Commit

Permalink
no source_location on clang
Browse files Browse the repository at this point in the history
  • Loading branch information
aremmell committed Jan 7, 2024
1 parent b96c8bf commit da12fcd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/bal/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
# include "types.h"

# if defined(__cplusplus)
# include <source_location>
# if _has_include(<source_location>)
# include <source_location>
# endif
extern "C" {
# endif

Expand Down Expand Up @@ -162,7 +164,7 @@ bool __bal_validate(bool expr, int err, const char* func, const char* file,
# if defined(BAL_DBGLOG)
void __bal_dbglog(const char* func, const char* file, uint32_t line,
const char* format, ...);
# if defined(__cplusplus)
# if defined(__cplusplus) && _has_include(<source_location>)
# define _bal_dbglog(...) \
do { \
std::source_location loc = std::source_location::current(); \
Expand Down

0 comments on commit da12fcd

Please sign in to comment.