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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 #define kFpuRegisterSize 8 | 117 #define kFpuRegisterSize 8 |
118 typedef double fpu_register_t; | 118 typedef double fpu_register_t; |
119 // TODO(johnmccutchan): MIPS simd type. | 119 // TODO(johnmccutchan): MIPS simd type. |
120 typedef struct { | 120 typedef struct { |
121 uint32_t data_[4]; | 121 uint32_t data_[4]; |
122 } simd_value_t; | 122 } simd_value_t; |
123 #else | 123 #else |
124 #error Architecture was not detected as supported by Dart. | 124 #error Architecture was not detected as supported by Dart. |
125 #endif | 125 #endif |
126 | 126 |
127 // DART_FORCE_INLINE strongly hints to the compiler that a function should | |
128 // be inlined. Your function is not guaranteed to be inlined but this is | |
129 // stronger than just using "inline". | |
130 // See: http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx for an | |
131 // explanation of some the cases when a function can never be inlined. | |
132 #ifdef _MSC_VER | |
133 #define DART_FORCE_INLINE __forceinline | |
134 #elif __GNUC__ | |
135 #define DART_FORCE_INLINE inline __attribute__((always_inline)) | |
136 #else | |
Søren Gjesse
2013/02/27 12:57:44
Wouldn't an empty define for DART_FORCE_INLINE wor
| |
137 #error Automatic compiler detection failed. | |
138 #endif | |
139 | |
127 #if !defined(TARGET_ARCH_MIPS) | 140 #if !defined(TARGET_ARCH_MIPS) |
128 #if !defined(TARGET_ARCH_ARM) | 141 #if !defined(TARGET_ARCH_ARM) |
129 #if !defined(TARGET_ARCH_X64) | 142 #if !defined(TARGET_ARCH_X64) |
130 #if !defined(TARGET_ARCH_IA32) | 143 #if !defined(TARGET_ARCH_IA32) |
131 // No target architecture specified pick the one matching the host architecture. | 144 // No target architecture specified pick the one matching the host architecture. |
132 #if defined(HOST_ARCH_MIPS) | 145 #if defined(HOST_ARCH_MIPS) |
133 #define TARGET_ARCH_MIPS 1 | 146 #define TARGET_ARCH_MIPS 1 |
134 #elif defined(HOST_ARCH_ARM) | 147 #elif defined(HOST_ARCH_ARM) |
135 #define TARGET_ARCH_ARM 1 | 148 #define TARGET_ARCH_ARM 1 |
136 #elif defined(HOST_ARCH_X64) | 149 #elif defined(HOST_ARCH_X64) |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
420 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods | 433 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods |
421 // have an implicit 'this' argument, the arguments of such methods | 434 // have an implicit 'this' argument, the arguments of such methods |
422 // should be counted from two, not one." | 435 // should be counted from two, not one." |
423 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ | 436 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ |
424 __attribute__((__format__(__printf__, string_index, first_to_check))) | 437 __attribute__((__format__(__printf__, string_index, first_to_check))) |
425 #else | 438 #else |
426 #define PRINTF_ATTRIBUTE(string_index, first_to_check) | 439 #define PRINTF_ATTRIBUTE(string_index, first_to_check) |
427 #endif | 440 #endif |
428 | 441 |
429 #endif // PLATFORM_GLOBALS_H_ | 442 #endif // PLATFORM_GLOBALS_H_ |
OLD | NEW |