diff --git a/Sources/OpenAttributeGraphCxx/Graph/OAGGraphTracing.cpp b/Sources/OpenAttributeGraphCxx/Graph/OAGGraphTracing.cpp index dedaa8df..69f030ba 100644 --- a/Sources/OpenAttributeGraphCxx/Graph/OAGGraphTracing.cpp +++ b/Sources/OpenAttributeGraphCxx/Graph/OAGGraphTracing.cpp @@ -3,6 +3,13 @@ // OpenAttributeGraphCxx #include +#include + +namespace OAG { +void Graph::trace_assertion_failure(bool remove, const char *format, ...) OAG_NOEXCEPT { + // TODO +} +} /* OAG */ void OAGGraphStartTracing(_Nullable OAGGraphRef graph, OAGGraphTraceOptions options) { OAGGraphStartTracing2(graph, options, NULL); diff --git a/Sources/OpenAttributeGraphCxx/Misc/assert.cpp b/Sources/OpenAttributeGraphCxx/Misc/assert.cpp index 08523dee..5c4450cf 100644 --- a/Sources/OpenAttributeGraphCxx/Misc/assert.cpp +++ b/Sources/OpenAttributeGraphCxx/Misc/assert.cpp @@ -4,11 +4,12 @@ #include #include +#include #include #include -char* error_message = nullptr; +static char* error_message = nullptr; namespace OAG { void precondition_failure(const char *format, ...) { @@ -19,9 +20,7 @@ void precondition_failure(const char *format, ...) { va_end(va); if (s != nullptr) { platform_log_error(error_log(), "precondition failure: %s", s); - #if OAG_TARGET_RELEASE >= OAG_RELEASE_2023 - // OAG::Graph::trace_assertion_failure(true, "precondition failure: %s", s) - #endif + Graph::trace_assertion_failure(true, "precondition failure: %s", s); if (error_message == nullptr) { asprintf(&error_message, "OpenAttributeGraph precondition failure: %s.\n", s); } @@ -38,8 +37,8 @@ void non_fatal_precondition_failure(const char *format, ...) { va_end(va); if (s != nullptr) { platform_log_fault(error_log(), "precondition failure: %s", s); + Graph::trace_assertion_failure(false, "precondition failure: %s", s); free(s); } - return; } } /* OAG */ diff --git a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraphCxx/Graph/Graph.hpp b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraphCxx/Graph/Graph.hpp index 37dbc0d8..10c8c45a 100644 --- a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraphCxx/Graph/Graph.hpp +++ b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraphCxx/Graph/Graph.hpp @@ -116,6 +116,8 @@ class Graph final { const void value_mark_all() const OAG_NOEXCEPT; + static void trace_assertion_failure(bool, const char *, ...) OAG_NOEXCEPT; + static void all_start_profiling(uint32_t) OAG_NOEXCEPT; static void all_stop_profiling() OAG_NOEXCEPT; void start_profiling(uint32_t) OAG_NOEXCEPT;