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