[ox/std] Add init hook to tracing system
This commit is contained in:
Vendored
+10
-1
@@ -13,9 +13,14 @@
|
||||
|
||||
#include "trace.hpp"
|
||||
|
||||
extern "C"
|
||||
extern "C" {
|
||||
|
||||
void oxTraceInitHook();
|
||||
|
||||
void oxTraceHook(const char *file, int line, const char *ch, const char *msg);
|
||||
|
||||
}
|
||||
|
||||
namespace ox::trace {
|
||||
|
||||
#if defined(OX_USE_STDLIB)
|
||||
@@ -65,4 +70,8 @@ void logError(const char *file, int line, Error err) {
|
||||
}
|
||||
}
|
||||
|
||||
void init() {
|
||||
oxTraceInitHook();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -128,6 +128,8 @@ using TraceStream = NullStream;
|
||||
|
||||
void logError(const char *file, int line, Error err);
|
||||
|
||||
void init();
|
||||
|
||||
}
|
||||
|
||||
#define oxLogError(err) ox::trace::logError(__FILE__, __LINE__, err)
|
||||
|
||||
Vendored
+7
-1
@@ -6,8 +6,14 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
extern "C"
|
||||
extern "C" {
|
||||
|
||||
void oxTraceInitHook() {
|
||||
}
|
||||
|
||||
void oxTraceHook([[maybe_unused]] const char *file, [[maybe_unused]] int line,
|
||||
[[maybe_unused]] const char *ch, [[maybe_unused]] const char *msg) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user