OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_BASE_MACROS_H_ | 5 #ifndef V8_BASE_MACROS_H_ |
6 #define V8_BASE_MACROS_H_ | 6 #define V8_BASE_MACROS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 #endif | 271 #endif |
272 | 272 |
273 #define V8PRIxPTR V8_PTR_PREFIX "x" | 273 #define V8PRIxPTR V8_PTR_PREFIX "x" |
274 #define V8PRIdPTR V8_PTR_PREFIX "d" | 274 #define V8PRIdPTR V8_PTR_PREFIX "d" |
275 #define V8PRIuPTR V8_PTR_PREFIX "u" | 275 #define V8PRIuPTR V8_PTR_PREFIX "u" |
276 | 276 |
277 // Fix for Mac OS X defining uintptr_t as "unsigned long": | 277 // Fix for Mac OS X defining uintptr_t as "unsigned long": |
278 #if V8_OS_MACOSX | 278 #if V8_OS_MACOSX |
279 #undef V8PRIxPTR | 279 #undef V8PRIxPTR |
280 #define V8PRIxPTR "lx" | 280 #define V8PRIxPTR "lx" |
| 281 #undef V8PRIuPTR |
| 282 #define V8PRIuPTR "lxu" |
281 #endif | 283 #endif |
282 | 284 |
283 // The following macro works on both 32 and 64-bit platforms. | 285 // The following macro works on both 32 and 64-bit platforms. |
284 // Usage: instead of writing 0x1234567890123456 | 286 // Usage: instead of writing 0x1234567890123456 |
285 // write V8_2PART_UINT64_C(0x12345678,90123456); | 287 // write V8_2PART_UINT64_C(0x12345678,90123456); |
286 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) | 288 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) |
287 | 289 |
288 | 290 |
289 // Compute the 0-relative offset of some absolute value x of type T. | 291 // Compute the 0-relative offset of some absolute value x of type T. |
290 // This allows conversion of Addresses and integral types into | 292 // This allows conversion of Addresses and integral types into |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 333 |
332 template <> | 334 template <> |
333 inline bool is_fundamental<uint8_t>() { | 335 inline bool is_fundamental<uint8_t>() { |
334 return true; | 336 return true; |
335 } | 337 } |
336 | 338 |
337 } // namespace base | 339 } // namespace base |
338 } // namespace v8 | 340 } // namespace v8 |
339 | 341 |
340 #endif // V8_BASE_MACROS_H_ | 342 #endif // V8_BASE_MACROS_H_ |
OLD | NEW |