nlib
Config_cafe.h
1 
2 #pragma once
3 #ifndef INCLUDE_NN_NLIB_CONFIG_CAFE_H_
4 #define INCLUDE_NN_NLIB_CONFIG_CAFE_H_
5 #ifndef INCLUDE_NN_NLIB_CONFIG_H_
6 # error do not include directly
7 #endif
8 #ifdef CAFE
9 
10 // Platform_cafe.cpp(MEMAllocFromDefaultHeapEx(size, boundary))
11 extern "C" void *memalign(size_t boundary, size_t size);
12 
13 typedef int FSStatus;
14 extern "C" extern FSStatus SAVEInit();
15 extern "C" extern void SAVEShutdown();
16 extern "C" extern void FSInit();
17 extern "C" extern void FSShutdown();
18 
19 #define NLIB_PATHMAPPER_FORSAMPLE \
20  nlib_ns::NativePathMapper g_PathMapper; \
21  inline void InitPathMapperForSample() { \
22  g_PathMapper.AddMap("/vol/save/nlibsample/", "nlibpath:
23  g_PathMapper.AddMap("/vol/save/nlibsample/", "nlibpath:
24  }
25 
26 #define NLIB_MAINFUNC int main(int argc, char** argv) { \
27  FSInit(); SAVEInit(); \
28  bool result = SampleMain(argc, argv); nlib_printf(result ? "OK\n" : "NG\n"); \
29  SAVEShutdown(); FSShutdown(); \
30  return result ? 0 : 1; }
31 
32 #define NLIB_ASSERT ASSERT
33 #define NLIB_ASSERT_NOERR(e) ASSERTMSG(((e) == 0), "%s", nlib_error_string(e))
34 
35 #define NLIB_ALIGNAS(x) __attribute__((aligned(x)))
36 #define NLIB_ALIGNOF(tp) __alignof__(tp)
37 
38 #define NLIB_CXX11_EXTERN_TEMPLATES
39 
40 #define NLIB_STD_SWAP_WORKAROUND
41 
42 #define NLIB_CXX11_SWAPHEADER
43 
44 #define NLIB_HAS_VIRTUALMEMORY
45 
46 #endif
47 #endif // INCLUDE_NN_NLIB_CONFIG_CAFE_H_