1 #include <cstdlib>
2 #include <cstdint>
3 #include <cxxabi.h>
4 
5 namespace __cxxabiv1
6 {
7 // 3.2.6 Pure Virtual Function API
__cxa_pure_virtual()8 extern "C" void __cxa_pure_virtual ()
9 {
10     while(true);
11 }
12 
13 // 3.2.7 Deleted Virtual Function API
__cxa_deleted_virtual()14 extern "C" void __cxa_deleted_virtual ()
15 {
16     while(true);
17 }
18 
19 // 3.3.2 One-time Construction API
20 // NOTE: Implementation does not support threads; no locking involved
21 
22 extern "C" int
__cxa_guard_acquire(__guard * _guard)23 __cxa_guard_acquire(__guard *_guard)
24 {
25     uint8_t *guard = reinterpret_cast<uint8_t*>(_guard);
26     return guard[0] ? 0 : 1;
27 }
28 
29 extern "C" void
__cxa_guard_release(__guard * _guard)30 __cxa_guard_release(__guard *_guard)
31 {
32     uint8_t *guard = reinterpret_cast<uint8_t*>(_guard);
33     guard[0] = 1;
34 }
35 
36 extern "C" void
__cxa_guard_abort(__guard * _guard)37 __cxa_guard_abort(__guard *_guard)
38 {
39     uint8_t *guard = reinterpret_cast<uint8_t*>(_guard);
40     guard[0] = 0;
41 }
42 
43 } // namespace __cxxabiv1
44