1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     rvct.h
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  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   $Rev: 26100 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_CONFIG_COMPILER_RVCT_H_
17 #define NN_CONFIG_COMPILER_RVCT_H_
18 
19 
20 #define NN_IS_UNUSED_VAR        __attribute__((unused))
21 #define NN_IS_UNUSED_FUNC       __attribute__((unused))
22 
23 #define NN_UNUSED_VAR(var)      ((void)&var);
24 
25 #define NN_FILE_NAME            __MODULE__
26 #define NN_FUNCTION             __PRETTY_FUNCTION__
27 
28 #define NN_WEAK_SYMBOL          __weak
29 #define NN_ASM                  __asm
30 
31 #define NN_FORCE_INLINE         __forceinline
32 #define NN_ATTRIBUTE_ALIGN(n)   __attribute__ ((aligned(n)))
33 #define NN_ATTRIBUTE_PACK       __attribute__ ((packed))
34 #define NN_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
35 #define NN_ATTRIBUTE_FORMAT(type, m, n) \
36                                 __attribute__ ((format(type,m,n)))
37 #define NN_ATTRIBUTE_NORETURN   __attribute__ ((noreturn))
38 
39 #define NN_LSYM( no )           no
40 #define NN_BSYM( no )           %b##no
41 #define NN_FSYM( no )           %f##no
42 
43 #define NN_DEFINE_MODULE_ID_STRING(name, value) \
44     static const char name[] __attribute__((section(".module_id"))) = (value)
45 
46 #define NN_DEFINE_STATIC_INIT_ARRAY(array, symbol) \
47 static void (*const array[])() __attribute__((used, section(".static_init"))) = { &symbol }
48 
49 
50 #define NN_ATTR_PRIVATE_SECTION_2(a, b) \
51     __attribute__((section(#a "." #b)))
52 
53 #define NN_ATTR_PRIVATE_SECTION_1(a, b) \
54     NN_ATTR_PRIVATE_SECTION_2(a, b)
55 
56 #define NN_ATTR_PRIVATE_SECTION \
57     NN_ATTR_PRIVATE_SECTION_1(NN_FILE_NAME, __LINE__)
58 
59 #define NN_FUNC_ATTR_PRIVATE_SECTION NN_ATTR_PRIVATE_SECTION
60 
61 // TORIAEZU: コンパイラ依存ではないのでここにあるのはおかしい
62 #define NN_PADDING1             int :  8
63 #define NN_PADDING2             int : 16
64 #define NN_PADDING3             int : 24
65 #define NN_PADDING4             int : 32
66 
67 
68 
69 /* NN_CONFIG_COMPILER_RVCT_H_ */
70 #endif
71