Skip to content

Commit

Permalink
remove source location as not portable enough
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Jan 8, 2025
1 parent 09344b6 commit b90cd0a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/my_source_loc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
#ifndef _MY_SOURCE_LOC_HPP_
#define _MY_SOURCE_LOC_HPP_

#if defined(__cpp_lib_source_location) && (__cpp_lib_source_location >= 201907L)
#include <source_location>
// Feature test macros https://en.cppreference.com/w/cpp/feature_test
#define SRC_FILE_NAME (std::source_location::current().file_name())
#define SRC_FUNC_NAME (std::source_location::current().function_name())
#define SRC_LINE_NUM (std::source_location::current().line())
#else
#define SRC_FILE_NAME __FILE__
#define SRC_FUNC_NAME __PRETTY_FUNCTION__
#define SRC_LINE_NUM __LINE__
#endif

#endif // _MY_SOURCE_LOC_HPP_

0 comments on commit b90cd0a

Please sign in to comment.