OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef PLATFORM_GLOBALS_H_ | 5 #ifndef PLATFORM_GLOBALS_H_ |
6 #define PLATFORM_GLOBALS_H_ | 6 #define PLATFORM_GLOBALS_H_ |
7 | 7 |
8 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to | 8 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to |
9 // enable platform independent printf format specifiers. | 9 // enable platform independent printf format specifiers. |
10 #ifndef __STDC_FORMAT_MACROS | 10 #ifndef __STDC_FORMAT_MACROS |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 #ifdef __GNUC__ | 189 #ifdef __GNUC__ |
190 #define DART_UNUSED __attribute__((unused)) | 190 #define DART_UNUSED __attribute__((unused)) |
191 #else | 191 #else |
192 #define DART_UNUSED | 192 #define DART_UNUSED |
193 #endif | 193 #endif |
194 | 194 |
195 #if !defined(TARGET_ARCH_MIPS) | 195 #if !defined(TARGET_ARCH_MIPS) |
196 #if !defined(TARGET_ARCH_ARM) | 196 #if !defined(TARGET_ARCH_ARM) |
197 #if !defined(TARGET_ARCH_X64) | 197 #if !defined(TARGET_ARCH_X64) |
198 #if !defined(TARGET_ARCH_IA32) | 198 #if !defined(TARGET_ARCH_IA32) |
| 199 #if !defined(TARGET_ARCH_ARM64) |
199 // No target architecture specified pick the one matching the host architecture. | 200 // No target architecture specified pick the one matching the host architecture. |
200 #if defined(HOST_ARCH_MIPS) | 201 #if defined(HOST_ARCH_MIPS) |
201 #define TARGET_ARCH_MIPS 1 | 202 #define TARGET_ARCH_MIPS 1 |
202 #elif defined(HOST_ARCH_ARM) | 203 #elif defined(HOST_ARCH_ARM) |
203 #define TARGET_ARCH_ARM 1 | 204 #define TARGET_ARCH_ARM 1 |
204 #elif defined(HOST_ARCH_X64) | 205 #elif defined(HOST_ARCH_X64) |
205 #define TARGET_ARCH_X64 1 | 206 #define TARGET_ARCH_X64 1 |
206 #elif defined(HOST_ARCH_IA32) | 207 #elif defined(HOST_ARCH_IA32) |
207 #define TARGET_ARCH_IA32 1 | 208 #define TARGET_ARCH_IA32 1 |
| 209 #elif defined(HOST_ARCH_ARM64) |
| 210 #define TARGET_ARCH_ARM64 1 |
208 #else | 211 #else |
209 #error Automatic target architecture detection failed. | 212 #error Automatic target architecture detection failed. |
210 #endif | 213 #endif |
211 #endif | 214 #endif |
212 #endif | 215 #endif |
213 #endif | 216 #endif |
214 #endif | 217 #endif |
| 218 #endif |
215 | 219 |
216 // Verify that host and target architectures match, we cannot | 220 // Verify that host and target architectures match, we cannot |
217 // have a 64 bit Dart VM generating 32 bit code or vice-versa. | 221 // have a 64 bit Dart VM generating 32 bit code or vice-versa. |
218 #if defined(TARGET_ARCH_X64) | 222 #if defined(TARGET_ARCH_X64) || \ |
| 223 defined(TARGET_ARCH_ARM64) |
219 #if !defined(ARCH_IS_64_BIT) | 224 #if !defined(ARCH_IS_64_BIT) |
220 #error Mismatched Host/Target architectures. | 225 #error Mismatched Host/Target architectures. |
221 #endif | 226 #endif |
222 #elif defined(TARGET_ARCH_IA32) || \ | 227 #elif defined(TARGET_ARCH_IA32) || \ |
223 defined(TARGET_ARCH_ARM) || \ | 228 defined(TARGET_ARCH_ARM) || \ |
224 defined(TARGET_ARCH_MIPS) | 229 defined(TARGET_ARCH_MIPS) |
225 #if !defined(ARCH_IS_32_BIT) | 230 #if !defined(ARCH_IS_32_BIT) |
226 #error Mismatched Host/Target architectures. | 231 #error Mismatched Host/Target architectures. |
227 #endif | 232 #endif |
228 #endif | 233 #endif |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods | 495 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods |
491 // have an implicit 'this' argument, the arguments of such methods | 496 // have an implicit 'this' argument, the arguments of such methods |
492 // should be counted from two, not one." | 497 // should be counted from two, not one." |
493 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ | 498 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ |
494 __attribute__((__format__(__printf__, string_index, first_to_check))) | 499 __attribute__((__format__(__printf__, string_index, first_to_check))) |
495 #else | 500 #else |
496 #define PRINTF_ATTRIBUTE(string_index, first_to_check) | 501 #define PRINTF_ATTRIBUTE(string_index, first_to_check) |
497 #endif | 502 #endif |
498 | 503 |
499 #endif // PLATFORM_GLOBALS_H_ | 504 #endif // PLATFORM_GLOBALS_H_ |
OLD | NEW |