nlib
Config_cafe.h
1
2
/*---------------------------------------------------------------------------*
3
4
Project: CrossRoad
5
Copyright (C)2012-2016 Nintendo. All rights reserved.
6
7
These coded instructions, statements, and computer programs contain
8
proprietary information of Nintendo of America Inc. and/or Nintendo
9
Company Ltd., and are protected by Federal copyright law. They may
10
not be disclosed to third parties or copied or duplicated in any form,
11
in whole or in part, without the prior written consent of Nintendo.
12
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
inline void InitPathMapperForSample() { \
35
g_PathMapper.AddMap("/vol/save/nlibsample/", "nlibpath:
36
g_PathMapper.AddMap("/vol/save/nlibsample/", "nlibpath:
37
}
38
39
#define NLIB_MAINFUNC int main(int argc, char** argv) { \
40
FSInit(); SAVEInit(); \
41
bool result = SampleMain(argc, argv); nlib_printf(result ? "OK\n" : "NG\n"); \
42
SAVEShutdown(); FSShutdown(); \
43
return result ? 0 : 1; }
44
45
#define NLIB_ASSERT ASSERT
46
#define NLIB_ASSERT_NOERR(e) ASSERTMSG(((e) == 0), "%s", nlib_error_string(e))
47
48
#define NLIB_ALIGNAS(x) __attribute__((aligned(x)))
49
#define NLIB_ALIGNOF(tp) __alignof__(tp)
50
51
#define NLIB_CXX11_EXTERN_TEMPLATES
52
53
#define NLIB_STD_SWAP_WORKAROUND
54
55
#define NLIB_CXX11_SWAPHEADER
56
57
#define NLIB_HAS_VIRTUALMEMORY
58
59
#endif
60
#endif // INCLUDE_NN_NLIB_CONFIG_CAFE_H_
© 2012-2016 Nintendo Co., Ltd. All rights reserved.