treelite
c_api_error.cc
1 
7 #include <dmlc/thread_local.h>
8 #include "./c_api_error.h"
9 
11  std::string last_error;
12 };
13 
14 typedef dmlc::ThreadLocalStore<TreeliteAPIErrorEntry> TreeliteAPIErrorStore;
15 
16 const char* TreeliteGetLastError() {
17  return TreeliteAPIErrorStore::Get()->last_error.c_str();
18 }
19 
20 void TreeliteAPISetLastError(const char* msg) {
21  TreeliteAPIErrorStore::Get()->last_error = msg;
22 }
Definition: c_api_error.cc:10