Sync the kernel with the single-definition error detail
build / windows (push) Has been cancelled
build / release (push) Has been cancelled

This commit is contained in:
TheM14 committed 2026-10-16 20:26:30 +08:00
1 parent 2cfebe914d
commit 40b0b4b6c4
4 files changed
+17 -3

No files matched your search

+1 -1
View File
@@ -11,6 +11,6 @@
#define JOC_VERSION_MAJOR 0 #define JOC_VERSION_MAJOR 0
#define JOC_VERSION_MINOR 1 #define JOC_VERSION_MINOR 1
#define JOC_VERSION_PATCH 0 #define JOC_VERSION_PATCH 0
#define JOC_VERSION_STRING "0.1.0" #define JOC_VERSION_STRING "1.0.0"
#endif /* JOC_VERSION_H */ #endif /* JOC_VERSION_H */
+1
View File
@@ -158,6 +158,7 @@
<ClCompile Include="src\foundation\fs_utf8.cpp" /> <ClCompile Include="src\foundation\fs_utf8.cpp" />
<ClCompile Include="src\foundation\mini_json.cpp" /> <ClCompile Include="src\foundation\mini_json.cpp" />
<ClCompile Include="src\foundation\sha256.cpp" /> <ClCompile Include="src\foundation\sha256.cpp" />
<ClCompile Include="src\foundation\status.cpp" />
<ClCompile Include="src\hrtf\jochrtf.cpp" /> <ClCompile Include="src\hrtf\jochrtf.cpp" />
<ClCompile Include="src\hrtf\public_filterbank.cpp" /> <ClCompile Include="src\hrtf\public_filterbank.cpp" />
<ClCompile Include="src\hrtf\rosella_model.cpp" /> <ClCompile Include="src\hrtf\rosella_model.cpp" />
+11
View File
@@ -0,0 +1,11 @@
#include "foundation/status.h"
namespace joc {
// The single definition of the per-thread detail string. It cannot live in the
// header: a thread_local with dynamic initialisation that is included by several
// translation units makes each of them emit its own TLS initialisation routine,
// and ld64 rejects those as duplicate symbols (GNU ld and MSVC fold them).
thread_local std::string last_error_detail;
} // namespace joc
+4 -2
View File
@@ -36,8 +36,10 @@ private:
// Structured detail of the most recent failing call, as returned by // Structured detail of the most recent failing call, as returned by
// joc_last_error_detail(). It is one instance per thread across the whole // joc_last_error_detail(). It is one instance per thread across the whole
// library, so every C entry point -- the task API and the streaming API alike -- // library, so every C entry point -- the task API and the streaming API alike --
// reports through the same string. // reports through the same string. Defined in status.cpp: a thread_local with
inline thread_local std::string last_error_detail; // dynamic initialisation defined in a header emits a TLS initialisation routine
// in every including unit, and ld64 rejects those duplicates.
extern thread_local std::string last_error_detail;
inline void record_error_detail(const Status& status) { inline void record_error_detail(const Status& status) {
if (status.ok()) { if (status.ok()) {