|
|
|
@ -13,15 +13,9 @@ namespace slns
|
|
|
|
|
current(
|
|
|
|
|
const char* fileName = __builtin_FILE(),
|
|
|
|
|
const char* functionName = __builtin_FUNCTION(),
|
|
|
|
|
const uint_least32_t lineNumber = __builtin_LINE(),
|
|
|
|
|
#if defined(__GNUC__) and (__GNUC__ > 4 or (__GNUC__ == 4 and __GNUC_MINOR__ >= 8))
|
|
|
|
|
const uint_least32_t columnOffset = 0)
|
|
|
|
|
#else
|
|
|
|
|
const uint_least32_t columnOffset = __builtin_COLUMN())
|
|
|
|
|
#endif
|
|
|
|
|
noexcept
|
|
|
|
|
const uint_least32_t lineNumber = __builtin_LINE()) noexcept
|
|
|
|
|
{
|
|
|
|
|
return source_location{fileName, functionName, lineNumber, columnOffset};
|
|
|
|
|
return source_location{fileName, functionName, lineNumber};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
source_location(const source_location&) = default;
|
|
|
|
@ -45,28 +39,15 @@ namespace slns
|
|
|
|
|
return lineNumber;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constexpr std::uint_least32_t
|
|
|
|
|
column() const noexcept
|
|
|
|
|
{
|
|
|
|
|
return columnOffset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
constexpr explicit source_location(
|
|
|
|
|
const char* fileName,
|
|
|
|
|
const char* functionName,
|
|
|
|
|
const uint_least32_t lineNumber,
|
|
|
|
|
const uint_least32_t columnOffset) noexcept
|
|
|
|
|
: fileName(fileName)
|
|
|
|
|
, functionName(functionName)
|
|
|
|
|
, lineNumber(lineNumber)
|
|
|
|
|
, columnOffset(columnOffset)
|
|
|
|
|
const char* fileName, const char* functionName, const uint_least32_t lineNumber) noexcept
|
|
|
|
|
: fileName(fileName), functionName(functionName), lineNumber(lineNumber)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
const char* fileName;
|
|
|
|
|
const char* functionName;
|
|
|
|
|
const std::uint_least32_t lineNumber;
|
|
|
|
|
const std::uint_least32_t columnOffset;
|
|
|
|
|
const char* const fileName;
|
|
|
|
|
const char* const functionName;
|
|
|
|
|
const uint_least32_t lineNumber;
|
|
|
|
|
};
|
|
|
|
|
} // namespace slns
|
|
|
|
|
#endif
|
|
|
|
|