feat fix SLED_FROM_HERE
All checks were successful
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 41s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 42s

This commit is contained in:
tqcq 2024-03-07 12:34:37 +08:00
parent 284bcf3972
commit 93ea3d11ef
2 changed files with 9 additions and 3 deletions

View File

@ -86,6 +86,7 @@ private:
};
using MutexLock = LockGuard<Mutex>;
using MutexGuard = LockGuard<Mutex>;
using RecursiveMutexLock = LockGuard<RecursiveMutex>;
// class MutexLock final {

View File

@ -16,15 +16,20 @@ class Location final {
public:
Location() = delete;
Location(const char *file_name, int file_line, const char *function);
static Location Current(const char *file_name = __builtin_FILE(),
int file_line = __builtin_LINE(),
const char *function = __builtin_FUNCTION());
std::string ToString() const;
private:
Location(const char *file_name, int file_line, const char *function);
const char *file() const { return file_name; };
int line() const { return file_line; };
const char *func() const { return function; };
private:
const char *file_name;
int file_line;
const char *function;
@ -32,6 +37,6 @@ private:
}// namespace sled
#define SLED_FROM_HERE sled::Location::Current();
#define SLED_FROM_HERE sled::Location::Current()
#endif// SLED_SYSTEM_LOCATION_H