1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     types.h
4 
5   Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain proprietary
8   information of Nintendo and/or its licensed developers and are protected by
9   national and international copyright laws. They may not be disclosed to third
10   parties or copied or duplicated in any form, in whole or in part, without the
11   prior written consent of Nintendo.
12 
13   The content herein is highly confidential and should be handled accordingly.
14 
15   $Revision: 31311 $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef NW_TYPES_H_
19 #define NW_TYPES_H_
20 
21 #define NW_CALL_DRAW_ELEMENTS_MANUALLY
22 #define NW_LINK_PROGRAM_MANUALLY
23 
24 #if !defined(NN_SWITCH_ENABLE_MEMBER_NAME_SHORTCUT)
25   #define NN_SWITCH_ENABLE_MEMBER_NAME_SHORTCUT
26 #endif
27 
28 #include <nw/config.h>
29 #include <nw/assert.h>
30 
31 #include <cstddef>
32 
33 #if !defined(NW_INLINE)
34   #define NW_INLINE     inline
35 #endif
36 
37 #if !defined(NW_FORCE_INLINE)
38   #if defined(NW_DEBUG)
39     #define NW_FORCE_INLINE     inline
40   #else
41     #define NW_FORCE_INLINE     __forceinline
42   #endif
43 #endif
44 
45 #if !defined( NW_DEV_DISABLED ) // NW_DEV_DISABLED が定義されていたら dev ライブラリを無効化します。
46   #define NW_DEV_ENABLED
47 #endif
48 
49 namespace nw
50 {
51 #ifdef NW_COMPILER_WITH_W64
52 typedef __w64 unsigned long IntPtr;
53 typedef __w64 signed long PtrDiff;
54 #else
55 typedef unsigned long IntPtr;
56 typedef signed long PtrDiff;
57 #endif
58 }
59 
60 #ifndef NW_ANY_TO_PTR_VALUE
61 #define NW_ANY_TO_PTR_VALUE(ptr) reinterpret_cast<nw::IntPtr>(reinterpret_cast<const void*>(ptr))
62 #endif
63 
64 #define NW_UNUSED_VARIABLE(Variable) (void)(&Variable);
65 
66 #ifdef NW_PLATFORM_CTR
67 #define NW_ALIGN_VARIABLE(Variable, n) Variable __attribute__ ((aligned(n)))
68 #else
69 #define NW_ALIGN_VARIABLE(Variable, n) __declspec(align(n)) Variable
70 #endif
71 
72 #ifdef NW_PLATFORM_CTR
73 #include <nn/version.h>
74   #if !defined(NW_USE_COMMAND_CACHE)
75     #define NW_USE_COMMAND_CACHE
76   #endif
77 #endif
78 
79 #define NW_SDK_VERSION  (((NN_VERSION_MAJOR) << 24) | ((NN_VERSION_MINOR) << 16)  | ((NN_VERSION_MICRO) << 8))
80 
81 /* NW_TYPES_H_ */
82 #endif
83