1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
4 // under the terms of the License "ARM EABI LICENCE.txt" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
6 // in kernel/eka/compsupp. |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
10 // |
10 // |
11 // Contributors: |
11 // Contributors: |
28 #if defined(__PRODUCT_INCLUDE__) |
26 #if defined(__PRODUCT_INCLUDE__) |
29 #include __PRODUCT_INCLUDE__ |
27 #include __PRODUCT_INCLUDE__ |
30 #endif |
28 #endif |
31 |
29 |
32 // stuff from e32def.h |
30 // stuff from e32def.h |
|
31 |
33 #define __NO_CLASS_CONSTS__ |
32 #define __NO_CLASS_CONSTS__ |
34 #define __NORETURN__ __declspec(noreturn) |
33 #define __NORETURN__ __declspec(noreturn) |
35 #define __NORETURN_TERMINATOR() |
34 #define __NORETURN_TERMINATOR() |
|
35 |
36 #define IMPORT_C __declspec(dllimport) |
36 #define IMPORT_C __declspec(dllimport) |
37 #define EXPORT_C __declspec(dllexport) |
37 #define EXPORT_C __declspec(dllexport) |
|
38 |
|
39 #define IMPORT_D __declspec(dllimport) |
|
40 #define EXPORT_D __declspec(dllexport) |
38 |
41 |
39 |
42 |
40 |
43 |
41 |
44 |
42 /** |
45 /** |
90 typedef unsigned short __TText; |
93 typedef unsigned short __TText; |
91 #endif |
94 #endif |
92 #define __TText_defined |
95 #define __TText_defined |
93 |
96 |
94 // __NAKED__ from cpudefs.h |
97 // __NAKED__ from cpudefs.h |
95 #define __NAKED__ __asm |
98 #define __NAKED__ __declspec(naked) |
96 #define ____ONLY_USE_NAKED_IN_CIA____ __asm |
99 #define ____ONLY_USE_NAKED_IN_CIA____ __declspec(naked) |
|
100 #define __WEAK__ __attribute__((weak)) |
97 |
101 |
98 // Int64 and Uint64 from nkern\nklib.h |
102 // Int64 and Uint64 from nkern\nklib.h |
99 typedef long long Int64; |
103 typedef long long Int64; |
100 typedef unsigned long long Uint64; |
104 typedef unsigned long long Uint64; |
101 |
105 |
102 // Here are GCC-E's definitions for stdarg.h |
106 // Here are GCC-E's definitions for stdarg.h |
103 // These should be used by e.g. stdlib |
107 // These should be used by e.g. stdlib |
104 |
108 |
105 #ifdef __cplusplus |
109 #ifdef __cplusplus |
106 namespace std { |
110 namespace std { extern "C" { |
107 extern "C" { |
111 #endif |
108 #endif /* __cplusplus */ |
|
109 |
112 |
110 typedef struct __va_list { void *__ap; } va_list; |
113 #if __GNUC__ < 4 |
111 |
114 typedef struct __va_list { void *__ap; } va_list; |
|
115 #else |
|
116 typedef __builtin_va_list va_list; |
|
117 #endif |
112 |
118 |
113 #ifdef __cplusplus |
119 #ifdef __cplusplus |
114 } /* extern "C" */ |
120 } } |
115 } /* namespace std */ |
|
116 |
|
117 using ::std::va_list; |
121 using ::std::va_list; |
118 #endif |
122 #endif |
119 |
123 |
|
124 #if __GNUC__ < 4 |
120 #define va_start(ap, parmN) __builtin_va_start(ap.__ap, parmN) |
125 #define va_start(ap, parmN) __builtin_va_start(ap.__ap, parmN) |
121 #define va_arg(ap, type) __builtin_va_arg(ap.__ap, type) |
126 #define va_arg(ap, type) __builtin_va_arg(ap.__ap, type) |
122 #define va_end(ap) __builtin_va_end(ap.__ap) |
127 #define va_end(ap) __builtin_va_end(ap.__ap) |
123 |
128 #else |
|
129 #define va_start(ap, parmN) __builtin_va_start(ap, parmN) |
|
130 #define va_arg(ap, type) __builtin_va_arg(ap, type) |
|
131 #define va_end(ap) __builtin_va_end(ap) |
|
132 #endif |
124 |
133 |
125 #define VA_LIST va_list |
134 #define VA_LIST va_list |
126 #define _VA_LIST_DEFINED //To deal with stdarg.h |
135 #define _VA_LIST_DEFINED //To deal with stdarg.h |
127 #define __VA_LIST_defined //To deal with e32def.h |
136 #define __VA_LIST_defined //To deal with e32def.h |
128 |
137 |
149 #define __EABI_CTORS__ |
158 #define __EABI_CTORS__ |
150 #endif |
159 #endif |
151 |
160 |
152 //#define __EARLY_DEBUG__ |
161 //#define __EARLY_DEBUG__ |
153 |
162 |
154 // Deal with operator new issues here |
163 #ifndef __SYMBIAN_STDCPP_SUPPORT__ |
155 #include "../symcpp.h" |
164 #include <symcpp.h> |
|
165 #endif |
156 |
166 |
157 #ifdef __cplusplus |
167 #ifdef __cplusplus |
158 // Support for throwing exceptions through embedded assembler |
168 // Support for throwing exceptions through embedded assembler |
159 // Should only be needed user side |
169 // Should only be needed user side |
160 |
170 |
161 #define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset |
171 #define __EH_FRAME_ADDRESS(reg,offset) FRAME ADDRESS reg, offset |
162 #define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2} |
172 #define __EH_FRAME_PUSH2(reg1,reg2) FRAME PUSH {reg1, reg2} |
163 #define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset |
173 #define __EH_FRAME_SAVE1(reg,offset) FRAME SAVE {reg}, offset |
164 |
174 |
165 #endif |
175 #endif |
|
176 |