7 #include <dmlc/thread_local.h> 8 #include "./c_api_error.h" 11 std::string last_error;
14 typedef dmlc::ThreadLocalStore<TreeliteAPIErrorEntry> TreeliteAPIErrorStore;
16 const char* TreeliteGetLastError() {
17 return TreeliteAPIErrorStore::Get()->last_error.c_str();
20 void TreeliteAPISetLastError(
const char* msg) {
21 TreeliteAPIErrorStore::Get()->last_error = msg;