|
| 1 | +#include "wums/wums_debug.h" |
1 | 2 | #include "wums_reent.h" |
2 | | -#include "wums_thread_specific.h" |
| 3 | + |
3 | 4 | #include <cstdio> |
4 | 5 | #include <cstring> |
5 | 6 |
|
| 7 | +extern "C" void OSFatal(const char *); |
6 | 8 | extern "C" void OSFatal(const char *); |
7 | 9 |
|
8 | 10 | int main(int argc, char **argv) { |
@@ -43,16 +45,22 @@ struct _reent *__getreent(void) { |
43 | 45 | return __wums_getreent(); |
44 | 46 | } |
45 | 47 |
|
46 | | -extern "C" void __attribute__((weak)) wut_set_thread_specific(__wut_thread_specific_id id, void *value); |
47 | | - |
48 | | -void wut_set_thread_specific(__wut_thread_specific_id id, void *value) { |
49 | | - return wums_set_thread_specific(id, value); |
50 | | -} |
| 48 | +typedef enum __wut_thread_specific_id { |
| 49 | + WUT_THREAD_SPECIFIC_0 = 0, |
| 50 | + WUT_THREAD_SPECIFIC_1 = 1, |
| 51 | +} __wut_thread_specific_id; |
51 | 52 |
|
52 | 53 | extern "C" void *__attribute__((weak)) wut_get_thread_specific(__wut_thread_specific_id id); |
53 | 54 |
|
54 | 55 | void *wut_get_thread_specific(__wut_thread_specific_id id) { |
55 | | - return wums_get_thread_specific(id); |
| 56 | + if ((uint32_t) id == 0x13371337) { // Mechanism to detect if the function was overridden properly |
| 57 | + return (void *) 0x42424242; |
| 58 | + } |
| 59 | + |
| 60 | + WUMS_DEBUG_WARN("wums_get_thread_specific: NOT SUPPORTED\n"); |
| 61 | + OSFatal("wums_get_thread_specific: NOT SUPPORTED\n"); |
| 62 | + |
| 63 | + return nullptr; |
56 | 64 | } |
57 | 65 |
|
58 | 66 | extern "C" const char wums_meta_module_name[]; |
@@ -100,6 +108,8 @@ __assert_func(const char *file, |
100 | 108 | } |
101 | 109 |
|
102 | 110 | OSFatal(buffer); |
| 111 | + while (true) |
| 112 | + ; |
103 | 113 | /* NOTREACHED */ |
104 | 114 | } |
105 | 115 |
|
|
0 commit comments