mirror of https://github.com/oxen-io/lokinet
use inline source_location implementation for android too
This commit is contained in:
parent
0546dab2e3
commit
18c5b43e63
|
@ -337,7 +337,7 @@ namespace llarp::quic
|
|||
va_start(ap, fmt);
|
||||
if (char* msg; vasprintf(&msg, fmt, ap) >= 0)
|
||||
{
|
||||
LogTraceExplicit("external/ngtcp2/*.c", 0, msg);
|
||||
LogTrace{msg};
|
||||
std::free(msg);
|
||||
}
|
||||
va_end(ap);
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <source_location>
|
||||
namespace slns = std;
|
||||
#else
|
||||
#ifdef __APPLE__
|
||||
namespace slns
|
||||
{
|
||||
struct source_location
|
||||
|
@ -15,7 +14,12 @@ namespace slns
|
|||
const char* fileName = __builtin_FILE(),
|
||||
const char* functionName = __builtin_FUNCTION(),
|
||||
const uint_least32_t lineNumber = __builtin_LINE(),
|
||||
const uint_least32_t columnOffset = __builtin_COLUMN()) noexcept
|
||||
#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
|
||||
{
|
||||
return source_location{fileName, functionName, lineNumber, columnOffset};
|
||||
}
|
||||
|
@ -65,8 +69,4 @@ namespace slns
|
|||
const std::uint_least32_t columnOffset;
|
||||
};
|
||||
} // namespace slns
|
||||
#else
|
||||
#include <experimental/source_location>
|
||||
namespace slns = std::experimental;
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue