1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     types.h
4 
5   Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc.  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   $Revision: 19475 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NW_TYPES_H_
17 #define NW_TYPES_H_
18 
19 #define NW_CALL_DRAW_ELEMENTS_MANUALLY
20 #define NW_LINK_PROGRAM_MANUALLY
21 
22 #if !defined(NN_SWITCH_ENABLE_MEMBER_NAME_SHORTCUT)
23   #define NN_SWITCH_ENABLE_MEMBER_NAME_SHORTCUT
24 #endif
25 
26 #include <nw/config.h>
27 #include <nw/assert.h>
28 
29 #include <cstddef>
30 
31 #if !defined(NW_INLINE)
32   #define NW_INLINE     inline
33 #endif
34 
35 #if !defined(NW_FORCE_INLINE)
36   #if defined(NW_DEBUG)
37     #define NW_FORCE_INLINE     inline
38   #else
39     #define NW_FORCE_INLINE     __forceinline
40   #endif
41 #endif
42 
43 #if !defined( NW_DEV_DISABLED ) // NW_DEV_DISABLED が定義されていたら dev ライブラリを無効化します。
44   #define NW_DEV_ENABLED
45 #endif
46 
47 namespace nw
48 {
49 #ifdef NW_COMPILER_WITH_W64
50 typedef __w64 unsigned long IntPtr;
51 typedef __w64 signed long PtrDiff;
52 #else
53 typedef unsigned long IntPtr;
54 typedef signed long PtrDiff;
55 #endif
56 }
57 
58 #ifndef NW_ANY_TO_PTR_VALUE
59 #define NW_ANY_TO_PTR_VALUE(ptr) reinterpret_cast<nw::IntPtr>(reinterpret_cast<const void*>(ptr))
60 #endif
61 
62 #define NW_UNUSED_VARIABLE(Variable) (void)(&Variable);
63 
64 #ifdef NW_PLATFORM_CTR
65 #define NW_ALIGN_VARIABLE(Variable, n) Variable __attribute__ ((aligned(n)))
66 #else
67 #define NW_ALIGN_VARIABLE(Variable, n) __declspec(align(n)) Variable
68 #endif
69 
70 #ifdef NW_PLATFORM_CTR
71 #include <nn/version.h>
72   #if !defined(NW_USE_COMMAND_CACHE)
73     #define NW_USE_COMMAND_CACHE
74   #endif
75 #endif
76 
77 #define NW_SDK_VERSION  (((NN_VERSION_MAJOR) << 24) | ((NN_VERSION_MINOR) << 16)  | ((NN_VERSION_MICRO) << 8))
78 
79 /* NW_TYPES_H_ */
80 #endif
81