Skip to content

Commit aec89b8

Browse files
committed
Fix the loader context init to be static for static lib
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 368ee3f commit aec89b8

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

source/lib/ze_lib.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,11 @@
1212

1313
namespace ze_lib
1414
{
15-
#ifdef DYNAMIC_LOAD_LOADER
16-
context_t &init_context() {
17-
static context_t loader_context;
18-
return loader_context;
19-
}
20-
#endif
2115
///////////////////////////////////////////////////////////////////////////////
2216
#ifndef DYNAMIC_LOAD_LOADER
2317
context_t *context;
2418
#else
25-
context_t *context = &init_context();
19+
context_t *context = &loader_context;
2620
#endif
2721
bool destruction = false;
2822

source/lib/ze_lib.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,8 @@ namespace ze_lib
177177

178178
extern context_t *context;
179179
extern bool destruction;
180+
#ifdef DYNAMIC_LOAD_LOADER
181+
static context_t loader_context;
182+
#endif
180183

181184
} // namespace ze_lib

0 commit comments

Comments
 (0)