Skip to content

Commit

Permalink
use macro to declare s_bmf_last_error
Browse files Browse the repository at this point in the history
  • Loading branch information
ruiqurm authored and sfeiwong committed Oct 30, 2024
1 parent 8990ab2 commit 19b8d48
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bmf/sdk/cpp_sdk/src/bmf_capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@

using namespace bmf_sdk;

#ifdef EMSCRIPTEN
// We use static linking in wasm, so the s_bmf_last_error should declare as extern.
extern thread_local std::string s_bmf_last_error;
#else
thread_local std::string s_bmf_last_error;
#endif

void bmf_set_last_error(const char *errstr) { s_bmf_last_error = errstr; }

Expand Down

0 comments on commit 19b8d48

Please sign in to comment.