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

Side by Side Diff: src/globals.h

Issue 9584047: Fix MinGW64 build. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | « SConstruct ('k') | src/platform-win32.cc » ('j') | 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 #define bool __my_bool__ // use 'indirection' to avoid name clashes 168 #define bool __my_bool__ // use 'indirection' to avoid name clashes
169 #endif 169 #endif
170 170
171 typedef uint8_t byte; 171 typedef uint8_t byte;
172 typedef byte* Address; 172 typedef byte* Address;
173 173
174 // Define our own macros for writing 64-bit constants. This is less fragile 174 // Define our own macros for writing 64-bit constants. This is less fragile
175 // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it 175 // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it
176 // works on compilers that don't have it (like MSVC). 176 // works on compilers that don't have it (like MSVC).
177 #if V8_HOST_ARCH_64_BIT 177 #if V8_HOST_ARCH_64_BIT
178 #ifdef _MSC_VER 178 #if defined(_MSC_VER)
179 #define V8_UINT64_C(x) (x ## UI64) 179 #define V8_UINT64_C(x) (x ## UI64)
180 #define V8_INT64_C(x) (x ## I64) 180 #define V8_INT64_C(x) (x ## I64)
181 #define V8_INTPTR_C(x) (x ## I64) 181 #define V8_INTPTR_C(x) (x ## I64)
182 #define V8_PTR_PREFIX "ll" 182 #define V8_PTR_PREFIX "ll"
183 #else // _MSC_VER 183 #elif defined(__MINGW64__)
184 #define V8_UINT64_C(x) (x ## ULL)
185 #define V8_INT64_C(x) (x ## LL)
186 #define V8_INTPTR_C(x) (x ## LL)
187 #define V8_PTR_PREFIX "I64"
188 #else
184 #define V8_UINT64_C(x) (x ## UL) 189 #define V8_UINT64_C(x) (x ## UL)
185 #define V8_INT64_C(x) (x ## L) 190 #define V8_INT64_C(x) (x ## L)
186 #define V8_INTPTR_C(x) (x ## L) 191 #define V8_INTPTR_C(x) (x ## L)
187 #define V8_PTR_PREFIX "l" 192 #define V8_PTR_PREFIX "l"
188 #endif // _MSC_VER 193 #endif
189 #else // V8_HOST_ARCH_64_BIT 194 #else // V8_HOST_ARCH_64_BIT
190 #define V8_INTPTR_C(x) (x) 195 #define V8_INTPTR_C(x) (x)
191 #define V8_PTR_PREFIX "" 196 #define V8_PTR_PREFIX ""
192 #endif // V8_HOST_ARCH_64_BIT 197 #endif // V8_HOST_ARCH_64_BIT
193 198
194 #ifdef __MINGW64__
195 #undef V8_PTR_PREFIX
196 #define V8_PTR_PREFIX "I64"
197 #endif // __MINGW64__
198
199 // The following macro works on both 32 and 64-bit platforms. 199 // The following macro works on both 32 and 64-bit platforms.
200 // Usage: instead of writing 0x1234567890123456 200 // Usage: instead of writing 0x1234567890123456
201 // write V8_2PART_UINT64_C(0x12345678,90123456); 201 // write V8_2PART_UINT64_C(0x12345678,90123456);
202 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) 202 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
203 203
204 #define V8PRIxPTR V8_PTR_PREFIX "x" 204 #define V8PRIxPTR V8_PTR_PREFIX "x"
205 #define V8PRIdPTR V8_PTR_PREFIX "d" 205 #define V8PRIdPTR V8_PTR_PREFIX "d"
206 206
207 // Fix for Mac OS X defining uintptr_t as "unsigned long": 207 // Fix for Mac OS X defining uintptr_t as "unsigned long":
208 #if defined(__APPLE__) && defined(__MACH__) 208 #if defined(__APPLE__) && defined(__MACH__)
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 // the backend, so both modes are represented by the kStrictMode value. 392 // the backend, so both modes are represented by the kStrictMode value.
393 enum StrictModeFlag { 393 enum StrictModeFlag {
394 kNonStrictMode, 394 kNonStrictMode,
395 kStrictMode 395 kStrictMode
396 }; 396 };
397 397
398 398
399 } } // namespace v8::internal 399 } } // namespace v8::internal
400 400
401 #endif // V8_GLOBALS_H_ 401 #endif // V8_GLOBALS_H_
OLDNEW
« no previous file with comments | « SConstruct ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698