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

Side by Side Diff: src/globals.h

Issue 23557002: Fix definition of V8_*_C() macros. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months 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 | « include/v8config.h ('k') | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 typedef unsigned int __my_bool__; 164 typedef unsigned int __my_bool__;
165 #define bool __my_bool__ // use 'indirection' to avoid name clashes 165 #define bool __my_bool__ // use 'indirection' to avoid name clashes
166 #endif 166 #endif
167 167
168 typedef uint8_t byte; 168 typedef uint8_t byte;
169 typedef byte* Address; 169 typedef byte* Address;
170 170
171 // Define our own macros for writing 64-bit constants. This is less fragile 171 // Define our own macros for writing 64-bit constants. This is less fragile
172 // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it 172 // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it
173 // works on compilers that don't have it (like MSVC). 173 // works on compilers that don't have it (like MSVC).
174 #if V8_HOST_ARCH_64_BIT 174 #if V8_CC_MSVC
175 #if defined(_MSC_VER) 175 # define V8_UINT64_C(x) (x ## UI64)
176 #define V8_UINT64_C(x) (x ## UI64) 176 # define V8_INT64_C(x) (x ## I64)
177 #define V8_INT64_C(x) (x ## I64) 177 # if V8_HOST_ARCH_64_BIT
178 #define V8_INTPTR_C(x) (x ## I64) 178 # define V8_INTPTR_C(x) (x ## I64)
179 #define V8_PTR_PREFIX "ll" 179 # define V8_PTR_PREFIX "ll"
180 #elif defined(__MINGW64__) 180 # else
181 #define V8_UINT64_C(x) (x ## ULL) 181 # define V8_INTPTR_C(x) (x)
182 #define V8_INT64_C(x) (x ## LL) 182 # define V8_PTR_PREFIX ""
183 #define V8_INTPTR_C(x) (x ## LL) 183 # endif // V8_HOST_ARCH_64_BIT
184 #define V8_PTR_PREFIX "I64" 184 #elif V8_CC_MINGW64
185 # define V8_UINT64_C(x) (x ## ULL)
186 # define V8_INT64_C(x) (x ## LL)
187 # define V8_INTPTR_C(x) (x ## LL)
188 # define V8_PTR_PREFIX "I64"
189 #elif V8_HOST_ARCH_64_BIT
190 # define V8_UINT64_C(x) (x ## UL)
191 # define V8_INT64_C(x) (x ## L)
192 # define V8_INTPTR_C(x) (x ## L)
193 # define V8_PTR_PREFIX "l"
185 #else 194 #else
186 #define V8_UINT64_C(x) (x ## UL) 195 # define V8_UINT64_C(x) (x ## ULL)
187 #define V8_INT64_C(x) (x ## L) 196 # define V8_INT64_C(x) (x ## LL)
188 #define V8_INTPTR_C(x) (x ## L) 197 # define V8_INTPTR_C(x) (x)
189 #define V8_PTR_PREFIX "l" 198 # define V8_PTR_PREFIX ""
190 #endif 199 #endif
191 #else // V8_HOST_ARCH_64_BIT
192 #define V8_INTPTR_C(x) (x)
193 #define V8_PTR_PREFIX ""
194 #endif // V8_HOST_ARCH_64_BIT
195 200
196 // The following macro works on both 32 and 64-bit platforms. 201 // The following macro works on both 32 and 64-bit platforms.
197 // Usage: instead of writing 0x1234567890123456 202 // Usage: instead of writing 0x1234567890123456
198 // write V8_2PART_UINT64_C(0x12345678,90123456); 203 // write V8_2PART_UINT64_C(0x12345678,90123456);
199 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) 204 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
200 205
201 #define V8PRIxPTR V8_PTR_PREFIX "x" 206 #define V8PRIxPTR V8_PTR_PREFIX "x"
202 #define V8PRIdPTR V8_PTR_PREFIX "d" 207 #define V8PRIdPTR V8_PTR_PREFIX "d"
203 #define V8PRIuPTR V8_PTR_PREFIX "u" 208 #define V8PRIuPTR V8_PTR_PREFIX "u"
204 209
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 // the backend, so both modes are represented by the kStrictMode value. 427 // the backend, so both modes are represented by the kStrictMode value.
423 enum StrictModeFlag { 428 enum StrictModeFlag {
424 kNonStrictMode, 429 kNonStrictMode,
425 kStrictMode 430 kStrictMode
426 }; 431 };
427 432
428 433
429 } } // namespace v8::internal 434 } } // namespace v8::internal
430 435
431 #endif // V8_GLOBALS_H_ 436 #endif // V8_GLOBALS_H_
OLDNEW
« no previous file with comments | « include/v8config.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698