| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_GLOBALS_H_ | 5 #ifndef V8_GLOBALS_H_ |
| 6 #define V8_GLOBALS_H_ | 6 #define V8_GLOBALS_H_ |
| 7 | 7 |
| 8 #include "include/v8stdint.h" | 8 #include "include/v8stdint.h" |
| 9 | 9 |
| 10 #include "src/base/build_config.h" | 10 #include "src/base/build_config.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 # endif | 94 # endif |
| 95 # define V8_INTPTR_C(x) (x ## L) | 95 # define V8_INTPTR_C(x) (x ## L) |
| 96 # define V8_PTR_PREFIX "l" | 96 # define V8_PTR_PREFIX "l" |
| 97 #else | 97 #else |
| 98 # define V8_UINT64_C(x) (x ## ULL) | 98 # define V8_UINT64_C(x) (x ## ULL) |
| 99 # define V8_INT64_C(x) (x ## LL) | 99 # define V8_INT64_C(x) (x ## LL) |
| 100 # define V8_INTPTR_C(x) (x) | 100 # define V8_INTPTR_C(x) (x) |
| 101 # define V8_PTR_PREFIX "" | 101 # define V8_PTR_PREFIX "" |
| 102 #endif | 102 #endif |
| 103 | 103 |
| 104 // The following macro works on both 32 and 64-bit platforms. | |
| 105 // Usage: instead of writing 0x1234567890123456 | |
| 106 // write V8_2PART_UINT64_C(0x12345678,90123456); | |
| 107 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) | |
| 108 | |
| 109 #define V8PRIxPTR V8_PTR_PREFIX "x" | 104 #define V8PRIxPTR V8_PTR_PREFIX "x" |
| 110 #define V8PRIdPTR V8_PTR_PREFIX "d" | 105 #define V8PRIdPTR V8_PTR_PREFIX "d" |
| 111 #define V8PRIuPTR V8_PTR_PREFIX "u" | 106 #define V8PRIuPTR V8_PTR_PREFIX "u" |
| 112 | 107 |
| 113 // Fix for Mac OS X defining uintptr_t as "unsigned long": | 108 // Fix for Mac OS X defining uintptr_t as "unsigned long": |
| 114 #if V8_OS_MACOSX | 109 #if V8_OS_MACOSX |
| 115 #undef V8PRIxPTR | 110 #undef V8PRIxPTR |
| 116 #define V8PRIxPTR "lx" | 111 #define V8PRIxPTR "lx" |
| 117 #endif | 112 #endif |
| 118 | 113 |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 enum MinusZeroMode { | 755 enum MinusZeroMode { |
| 761 TREAT_MINUS_ZERO_AS_ZERO, | 756 TREAT_MINUS_ZERO_AS_ZERO, |
| 762 FAIL_ON_MINUS_ZERO | 757 FAIL_ON_MINUS_ZERO |
| 763 }; | 758 }; |
| 764 | 759 |
| 765 } } // namespace v8::internal | 760 } } // namespace v8::internal |
| 766 | 761 |
| 767 namespace i = v8::internal; | 762 namespace i = v8::internal; |
| 768 | 763 |
| 769 #endif // V8_GLOBALS_H_ | 764 #endif // V8_GLOBALS_H_ |
| OLD | NEW |