feat fix SLED_FROM_HERE
This commit is contained in:
parent
284bcf3972
commit
93ea3d11ef
@ -86,6 +86,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
using MutexLock = LockGuard<Mutex>;
|
using MutexLock = LockGuard<Mutex>;
|
||||||
|
using MutexGuard = LockGuard<Mutex>;
|
||||||
using RecursiveMutexLock = LockGuard<RecursiveMutex>;
|
using RecursiveMutexLock = LockGuard<RecursiveMutex>;
|
||||||
|
|
||||||
// class MutexLock final {
|
// class MutexLock final {
|
||||||
|
@ -16,15 +16,20 @@ class Location final {
|
|||||||
public:
|
public:
|
||||||
Location() = delete;
|
Location() = delete;
|
||||||
|
|
||||||
|
Location(const char *file_name, int file_line, const char *function);
|
||||||
static Location Current(const char *file_name = __builtin_FILE(),
|
static Location Current(const char *file_name = __builtin_FILE(),
|
||||||
int file_line = __builtin_LINE(),
|
int file_line = __builtin_LINE(),
|
||||||
const char *function = __builtin_FUNCTION());
|
const char *function = __builtin_FUNCTION());
|
||||||
|
|
||||||
std::string ToString() const;
|
std::string ToString() const;
|
||||||
|
|
||||||
private:
|
const char *file() const { return file_name; };
|
||||||
Location(const char *file_name, int file_line, const char *function);
|
|
||||||
|
|
||||||
|
int line() const { return file_line; };
|
||||||
|
|
||||||
|
const char *func() const { return function; };
|
||||||
|
|
||||||
|
private:
|
||||||
const char *file_name;
|
const char *file_name;
|
||||||
int file_line;
|
int file_line;
|
||||||
const char *function;
|
const char *function;
|
||||||
@ -32,6 +37,6 @@ private:
|
|||||||
|
|
||||||
}// namespace sled
|
}// namespace sled
|
||||||
|
|
||||||
#define SLED_FROM_HERE sled::Location::Current();
|
#define SLED_FROM_HERE sled::Location::Current()
|
||||||
|
|
||||||
#endif// SLED_SYSTEM_LOCATION_H
|
#endif// SLED_SYSTEM_LOCATION_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user