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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 const uint32_t kMaxUint32 = 0xFFFFFFFF; | 248 const uint32_t kMaxUint32 = 0xFFFFFFFF; |
249 const int64_t kMinInt64 = DART_INT64_C(0x8000000000000000); | 249 const int64_t kMinInt64 = DART_INT64_C(0x8000000000000000); |
250 const int64_t kMaxInt64 = DART_INT64_C(0x7FFFFFFFFFFFFFFF); | 250 const int64_t kMaxInt64 = DART_INT64_C(0x7FFFFFFFFFFFFFFF); |
251 const uint64_t kMaxUint64 = DART_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF); | 251 const uint64_t kMaxUint64 = DART_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF); |
252 | 252 |
253 // Types for native machine words. Guaranteed to be able to hold pointers and | 253 // Types for native machine words. Guaranteed to be able to hold pointers and |
254 // integers. | 254 // integers. |
255 typedef intptr_t word; | 255 typedef intptr_t word; |
256 typedef uintptr_t uword; | 256 typedef uintptr_t uword; |
257 | 257 |
| 258 #if defined(TARGET_OS_WINDOWS) || defined(TARGET_OS_MACOS) |
| 259 // off64_t is not defined on Windows or Mac OS. |
| 260 typedef int64_t off64_t; |
| 261 #endif |
| 262 |
258 // Byte sizes. | 263 // Byte sizes. |
259 const int kWordSize = sizeof(word); | 264 const int kWordSize = sizeof(word); |
260 const int kDoubleSize = sizeof(double); // NOLINT | 265 const int kDoubleSize = sizeof(double); // NOLINT |
261 const int kFloatSize = sizeof(float); // NOLINT | 266 const int kFloatSize = sizeof(float); // NOLINT |
262 const int kSimd128Size = sizeof(simd128_value_t); // NOLINT | 267 const int kSimd128Size = sizeof(simd128_value_t); // NOLINT |
263 #ifdef ARCH_IS_32_BIT | 268 #ifdef ARCH_IS_32_BIT |
264 const int kWordSizeLog2 = 2; | 269 const int kWordSizeLog2 = 2; |
265 const uword kUwordMax = kMaxUint32; | 270 const uword kUwordMax = kMaxUint32; |
266 #else | 271 #else |
267 const int kWordSizeLog2 = 3; | 272 const int kWordSizeLog2 = 3; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods | 494 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods |
490 // have an implicit 'this' argument, the arguments of such methods | 495 // have an implicit 'this' argument, the arguments of such methods |
491 // should be counted from two, not one." | 496 // should be counted from two, not one." |
492 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ | 497 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ |
493 __attribute__((__format__(__printf__, string_index, first_to_check))) | 498 __attribute__((__format__(__printf__, string_index, first_to_check))) |
494 #else | 499 #else |
495 #define PRINTF_ATTRIBUTE(string_index, first_to_check) | 500 #define PRINTF_ATTRIBUTE(string_index, first_to_check) |
496 #endif | 501 #endif |
497 | 502 |
498 #endif // PLATFORM_GLOBALS_H_ | 503 #endif // PLATFORM_GLOBALS_H_ |
OLD | NEW |