| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 const int kWordSizeLog2 = 3; | 160 const int kWordSizeLog2 = 3; |
| 161 const uword kUwordMax = kMaxUint64; | 161 const uword kUwordMax = kMaxUint64; |
| 162 #endif | 162 #endif |
| 163 | 163 |
| 164 // Bit sizes. | 164 // Bit sizes. |
| 165 const int kBitsPerByte = 8; | 165 const int kBitsPerByte = 8; |
| 166 const int kBitsPerByteLog2 = 3; | 166 const int kBitsPerByteLog2 = 3; |
| 167 const int kBitsPerWord = kWordSize * kBitsPerByte; | 167 const int kBitsPerWord = kWordSize * kBitsPerByte; |
| 168 | 168 |
| 169 // System-wide named constants. | 169 // System-wide named constants. |
| 170 const int KB = 1024; | 170 const intptr_t KB = 1024; |
| 171 const int MB = KB * KB; | 171 const intptr_t MB = KB * KB; |
| 172 const int GB = KB * KB * KB; | 172 const intptr_t GB = KB * KB * KB; |
| 173 const intptr_t kIntptrOne = 1; | 173 const intptr_t kIntptrOne = 1; |
| 174 const intptr_t kIntptrMin = (kIntptrOne << (kBitsPerWord - 1)); | 174 const intptr_t kIntptrMin = (kIntptrOne << (kBitsPerWord - 1)); |
| 175 const intptr_t kIntptrMax = ~kIntptrMin; | 175 const intptr_t kIntptrMax = ~kIntptrMin; |
| 176 | 176 |
| 177 // Time constants. | 177 // Time constants. |
| 178 const int kMillisecondsPerSecond = 1000; | 178 const int kMillisecondsPerSecond = 1000; |
| 179 const int kMicrosecondsPerMillisecond = 1000; | 179 const int kMicrosecondsPerMillisecond = 1000; |
| 180 const int kMicrosecondsPerSecond = (kMicrosecondsPerMillisecond * | 180 const int kMicrosecondsPerSecond = (kMicrosecondsPerMillisecond * |
| 181 kMillisecondsPerSecond); | 181 kMillisecondsPerSecond); |
| 182 const int kNanosecondsPerMicrosecond = 1000; | 182 const int kNanosecondsPerMicrosecond = 1000; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // have an implicit 'this' argument, the arguments of such methods | 361 // have an implicit 'this' argument, the arguments of such methods |
| 362 // should be counted from two, not one." | 362 // should be counted from two, not one." |
| 363 // | 363 // |
| 364 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ | 364 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ |
| 365 __attribute__((__format__(__printf__, string_index, first_to_check))) | 365 __attribute__((__format__(__printf__, string_index, first_to_check))) |
| 366 #else | 366 #else |
| 367 #define PRINTF_ATTRIBUTE(string_index, first_to_check) | 367 #define PRINTF_ATTRIBUTE(string_index, first_to_check) |
| 368 #endif | 368 #endif |
| 369 | 369 |
| 370 #endif // PLATFORM_GLOBALS_H_ | 370 #endif // PLATFORM_GLOBALS_H_ |
| OLD | NEW |