1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - - types definition
3   File:     types.h
4 
5   Copyright 2003-2008 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   $Date:: 2008-09-17#$
14   $Rev: 8556 $
15   $Author: okubata_ryoma $
16  *---------------------------------------------------------------------------*/
17 #ifndef NITRO_TYPES_H_
18 #define NITRO_TYPES_H_
19 
20 // Endian
21 #define SDK_LITTLE_ENDIAN
22 #define SDK_IS_LITTLE_ENDIAN	1
23 #define SDK_IS_BIG_ENDIAN	0
24 
25 #ifdef  SDK_ASM
26 #else  //SDK_ASM
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 typedef unsigned char u8;
33 typedef unsigned short int u16;
34 typedef unsigned long u32;
35 
36 #ifdef SDK_HAS_NO_LONG_LONG_INT_
37 typedef unsigned __int64 u64;
38 #else
39 typedef unsigned long long int u64;
40 #endif
41 
42 typedef signed char s8;
43 typedef signed short int s16;
44 typedef signed long s32;
45 
46 #ifdef SDK_HAS_NO_LONG_LONG_INT_
47 typedef signed __int64 s64;
48 #else
49 typedef signed long long int s64;
50 #endif
51 
52 typedef volatile u8 vu8;
53 typedef volatile u16 vu16;
54 typedef volatile u32 vu32;
55 typedef volatile u64 vu64;
56 
57 typedef volatile s8 vs8;
58 typedef volatile s16 vs16;
59 typedef volatile s32 vs32;
60 typedef volatile s64 vs64;
61 
62 typedef float f32;
63 typedef volatile f32 vf32;
64 
65 /*
66     Macro and types used with io_register_list_XX.h
67  */
68 
69 typedef u8 REGType8;
70 typedef u16 REGType16;
71 typedef u32 REGType32;
72 typedef u64 REGType64;
73 
74 typedef vu8 REGType8v;
75 typedef vu16 REGType16v;
76 typedef vu32 REGType32v;
77 typedef vu64 REGType64v;
78 
79 
80 #ifndef SDK_BOOL_ALREADY_DEFINED_
81 #ifndef BOOL
82 typedef int BOOL;
83 #endif //BOOL
84 #endif //SDK_ALREAD_DEFINE_BOOL_
85 
86 #ifndef TRUE
87 // Any non-zero value is considered TRUE
88 #define TRUE                    1
89 #endif //TRUE
90 
91 #ifndef FALSE
92 #define FALSE                   0
93 #endif // FALSE
94 
95 
96 #ifndef NULL
97 #ifdef  __cplusplus
98 #define NULL                    0
99 #else  // __cplusplus
100 #define NULL                ((void *)0)
101 #endif // __cplusplus
102 #endif // NULL
103 
104 // For compatibility with GAMECUBE
105 #if     defined(SDK_CW) || defined(SDK_RX) || defined(__MWERKS__)
106 #ifndef ATTRIBUTE_ALIGN
107 #define ATTRIBUTE_ALIGN(num) __attribute__ ((aligned(num)))
108 #endif
109 #endif
110 
111 // Weak symbol
112 #if     defined(SDK_CW) || defined(SDK_RX) || defined(__MWERKS__)
113 #define SDK_WEAK_SYMBOL  __declspec(weak)
114 #elif   defined(SDK_PRODG)
115 #define SDK_WEAK_SYMBOL
116 #endif
117 
118 /* Option for the compiler that deals with dead-stripping */
119 #ifdef  SDK_CW_FORCE_EXPORT_SUPPORT
120 #define SDK_FORCE_EXPORT   __declspec(force_export)
121 #else
122 #define SDK_FORCE_EXPORT
123 #endif
124 
125 #ifdef __cplusplus
126 } /* extern "C" */
127 #endif
128 #endif //SDK_ASM
129 
130 
131 /* When you want to make static inline into inline and reduce the code size, change the macro SDK_INLINE.
132    (When there is a declaration that makes static inline into inline, also change SDK_DECL_INLINE))
133    Rebuild the library if changes are made.
134 
135    However, using a version of the compiler in which the inline function materialization bug has been fixed, code size can be reduced if this macro is used to change static inline to inline only in functions where static was changed to static inline to avoid the bug
136 
137 
138 
139    Note: These macros are currently valid with only the FX_, VEC_, and MTX_ series*/
140 #define SDK_INLINE      static inline
141 #define SDK_DECL_INLINE static
142 
143 
144 /* NITRO_TYPES_H_ */
145 #endif
146