nlib
Config_cafe.h
1
2
/*--------------------------------------------------------------------------------*
3
Project: CrossRoad
4
Copyright (C)Nintendo All rights reserved.
5
6
These coded instructions, statements, and computer programs contain proprietary
7
information of Nintendo and/or its licensed developers and are protected by
8
national and international copyright laws. They may not be disclosed to third
9
parties or copied or duplicated in any form, in whole or in part, without the
10
prior written consent of Nintendo.
11
12
The content herein is highly confidential and should be handled accordingly.
13
*--------------------------------------------------------------------------------*/
14
15
#pragma once
16
#ifndef INCLUDE_NN_NLIB_CONFIG_CAFE_H_
17
#define INCLUDE_NN_NLIB_CONFIG_CAFE_H_
18
#ifndef INCLUDE_NN_NLIB_CONFIG_H_
19
# error do not include directly
20
#endif
21
#ifdef CAFE
22
23
// Platform_cafe.cpp(MEMAllocFromDefaultHeapEx(size, boundary))
24
extern
"C"
void
*memalign(
size_t
boundary,
size_t
size);
25
26
typedef
int
FSStatus;
27
extern
"C"
extern
FSStatus SAVEInit();
28
extern
"C"
extern
void
SAVEShutdown();
29
extern
"C"
extern
void
FSInit();
30
extern
"C"
extern
void
FSShutdown();
31
32
#define NLIB_PATHMAPPER_FORSAMPLE \
33
nlib_ns::NativePathMapper g_pathmapper; \
34
nlib_ns::NativePathMapper& g_PathMapper = g_pathmapper; \
35
inline void InitPathMapperForSample() { \
36
g_pathmapper.AddMap("/vol/save/nlibsample/", "nlibpath:
37
g_pathmapper.AddMap("/vol/save/nlibsample/", "nlibpath:
38
}
39
40
#define NLIB_MAINFUNC int main(int argc, char** argv) { \
41
FSInit(); SAVEInit(); \
42
bool result = SampleMain(argc, argv); nlib_printf(result ? "OK\n" : "NG\n"); \
43
SAVEShutdown(); FSShutdown(); \
44
return result ? 0 : 1; }
45
46
#define NLIB_ASSERT ASSERT
47
#define NLIB_ASSERT_NOERR(e) ASSERTMSG(((e) == 0), "%s", nlib_error_string(e))
48
49
#define NLIB_ALIGNAS(x) __attribute__((aligned(x)))
50
#define NLIB_ALIGNOF(tp) __alignof__(tp)
51
52
#define NLIB_CXX11_EXTERN_TEMPLATES
53
54
#define NLIB_STD_SWAP_WORKAROUND
55
56
#define NLIB_CXX11_SWAPHEADER
57
58
#define NLIB_HAS_VIRTUALMEMORY
59
60
#endif
61
#endif // INCLUDE_NN_NLIB_CONFIG_CAFE_H_
© 2012-2017 Nintendo Co., Ltd. All rights reserved.