| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 const uint64_t kMaxUint64 = DART_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF); | 145 const uint64_t kMaxUint64 = DART_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF); |
| 146 | 146 |
| 147 // Types for native machine words. Guaranteed to be able to hold pointers and | 147 // Types for native machine words. Guaranteed to be able to hold pointers and |
| 148 // integers. | 148 // integers. |
| 149 typedef intptr_t word; | 149 typedef intptr_t word; |
| 150 typedef uintptr_t uword; | 150 typedef uintptr_t uword; |
| 151 | 151 |
| 152 // Byte sizes. | 152 // Byte sizes. |
| 153 const int kWordSize = sizeof(word); | 153 const int kWordSize = sizeof(word); |
| 154 const int kDoubleSize = sizeof(double); // NOLINT | 154 const int kDoubleSize = sizeof(double); // NOLINT |
| 155 const int kFloatSize = sizeof(float); // NOLINT |
| 155 #ifdef ARCH_IS_32_BIT | 156 #ifdef ARCH_IS_32_BIT |
| 156 const int kWordSizeLog2 = 2; | 157 const int kWordSizeLog2 = 2; |
| 157 const uword kUwordMax = kMaxUint32; | 158 const uword kUwordMax = kMaxUint32; |
| 158 #else | 159 #else |
| 159 const int kWordSizeLog2 = 3; | 160 const int kWordSizeLog2 = 3; |
| 160 const uword kUwordMax = kMaxUint64; | 161 const uword kUwordMax = kMaxUint64; |
| 161 #endif | 162 #endif |
| 162 | 163 |
| 163 // Bit sizes. | 164 // Bit sizes. |
| 164 const int kBitsPerByte = 8; | 165 const int kBitsPerByte = 8; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 // have an implicit 'this' argument, the arguments of such methods | 361 // have an implicit 'this' argument, the arguments of such methods |
| 361 // should be counted from two, not one." | 362 // should be counted from two, not one." |
| 362 // | 363 // |
| 363 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ | 364 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ |
| 364 __attribute__((__format__(__printf__, string_index, first_to_check))) | 365 __attribute__((__format__(__printf__, string_index, first_to_check))) |
| 365 #else | 366 #else |
| 366 #define PRINTF_ATTRIBUTE(string_index, first_to_check) | 367 #define PRINTF_ATTRIBUTE(string_index, first_to_check) |
| 367 #endif | 368 #endif |
| 368 | 369 |
| 369 #endif // PLATFORM_GLOBALS_H_ | 370 #endif // PLATFORM_GLOBALS_H_ |
| OLD | NEW |