Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: runtime/vm/globals.h

Issue 8604007: Add macros for specifying 64-bit integer literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 VM_GLOBALS_H_ 5 #ifndef VM_GLOBALS_H_
6 #define VM_GLOBALS_H_ 6 #define VM_GLOBALS_H_
7 7
8 // __STDC_FORMAT_MACROS has to be defined to enable platform independent printf. 8 // __STDC_FORMAT_MACROS has to be defined to enable platform independent printf.
9 #ifndef __STDC_FORMAT_MACROS 9 #ifndef __STDC_FORMAT_MACROS
10 #define __STDC_FORMAT_MACROS 10 #define __STDC_FORMAT_MACROS
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // Printf format for intptr_t on Windows. 118 // Printf format for intptr_t on Windows.
119 #if !defined(PRIxPTR) && defined(TARGET_OS_WINDOWS) 119 #if !defined(PRIxPTR) && defined(TARGET_OS_WINDOWS)
120 #if defined(ARCH_IS_32_BIT) 120 #if defined(ARCH_IS_32_BIT)
121 #define PRIxPTR "x" 121 #define PRIxPTR "x"
122 #else 122 #else
123 #define PRIxPTR "llx" 123 #define PRIxPTR "llx"
124 #endif // defined(ARCH_IS_32_BIT) 124 #endif // defined(ARCH_IS_32_BIT)
125 #endif // !defined(PRIxPTR) && defined(TARGET_OS_WINDOWS) 125 #endif // !defined(PRIxPTR) && defined(TARGET_OS_WINDOWS)
126 126
127 127
128 // Suffixes for 64-bit integer literals.
129 #ifdef _MSC_VER
130 #define DART_INT64_C(x) x##I64
131 #define DART_UINT64_C(x) x##UI64
132 #else
133 #define DART_INT64_C(x) x##LL
134 #define DART_UINT64_C(x) x##ULL
135 #endif
136
137
128 // The following macro works on both 32 and 64-bit platforms. 138 // The following macro works on both 32 and 64-bit platforms.
129 // Usage: instead of writing 0x1234567890123456 139 // Usage: instead of writing 0x1234567890123456
130 // write DART_2PART_UINT64_C(0x12345678,90123456); 140 // write DART_2PART_UINT64_C(0x12345678,90123456);
131 #define DART_2PART_UINT64_C(a, b) \ 141 #define DART_2PART_UINT64_C(a, b) \
132 (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) 142 (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
133 143
134 144
135 // Types for native machine words. Guaranteed to be able to hold pointers and 145 // Types for native machine words. Guaranteed to be able to hold pointers and
136 // integers. 146 // integers.
137 typedef intptr_t word; 147 typedef intptr_t word;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 // contants are 16 byte aligned. 351 // contants are 16 byte aligned.
342 #if defined(TARGET_OS_WINDOWS) 352 #if defined(TARGET_OS_WINDOWS)
343 #define ALIGN16 __declspec(align(16)) 353 #define ALIGN16 __declspec(align(16))
344 #else 354 #else
345 #define ALIGN16 __attribute__((aligned(16))) 355 #define ALIGN16 __attribute__((aligned(16)))
346 #endif 356 #endif
347 357
348 } // namespace dart 358 } // namespace dart
349 359
350 #endif // VM_GLOBALS_H_ 360 #endif // VM_GLOBALS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698