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

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

Issue 2757783003: Set TARGET_OS_* from GN, falling back to HOST_OS_*. (Closed)
Patch Set: . Created 3 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
« no previous file with comments | « runtime/BUILD.gn ('k') | runtime/vm/constants_arm.h » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 RUNTIME_PLATFORM_GLOBALS_H_ 5 #ifndef RUNTIME_PLATFORM_GLOBALS_H_
6 #define RUNTIME_PLATFORM_GLOBALS_H_ 6 #define RUNTIME_PLATFORM_GLOBALS_H_
7 7
8 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to 8 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to
9 // enable platform independent printf format specifiers. 9 // enable platform independent printf format specifiers.
10 #ifndef __STDC_FORMAT_MACROS 10 #ifndef __STDC_FORMAT_MACROS
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 #define HOST_OS_LINUX 1 95 #define HOST_OS_LINUX 1
96 96
97 #elif defined(__APPLE__) 97 #elif defined(__APPLE__)
98 98
99 // Define the flavor of Mac OS we are running on. 99 // Define the flavor of Mac OS we are running on.
100 #include <TargetConditionals.h> 100 #include <TargetConditionals.h>
101 // TODO(iposva): Rename HOST_OS_MACOS to HOST_OS_MAC to inherit 101 // TODO(iposva): Rename HOST_OS_MACOS to HOST_OS_MAC to inherit
102 // the value defined in TargetConditionals.h 102 // the value defined in TargetConditionals.h
103 #define HOST_OS_MACOS 1 103 #define HOST_OS_MACOS 1
104 #if TARGET_OS_IPHONE 104 #if TARGET_OS_IPHONE
105 // Test for this #define by saying '#if TARGET_OS_IOS' rather than the usual
106 // '#if defined(TARGET_OS_IOS)'. TARGET_OS_IOS is defined to be 0 in
107 // XCode >= 7.0. See Issue #24453.
108 #define HOST_OS_IOS 1 105 #define HOST_OS_IOS 1
109 #endif 106 #endif
110 107
111 #elif defined(_WIN32) 108 #elif defined(_WIN32)
112 109
113 // Windows, both 32- and 64-bit, regardless of the check for _WIN32. 110 // Windows, both 32- and 64-bit, regardless of the check for _WIN32.
114 #define HOST_OS_WINDOWS 1 111 #define HOST_OS_WINDOWS 1
115 112
116 #elif defined(__Fuchsia__) 113 #elif defined(__Fuchsia__)
117 #define HOST_OS_FUCHSIA 114 #define HOST_OS_FUCHSIA
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 #endif 300 #endif
304 301
305 #ifdef _MSC_VER 302 #ifdef _MSC_VER
306 #define DART_PRETTY_FUNCTION __FUNCSIG__ 303 #define DART_PRETTY_FUNCTION __FUNCSIG__
307 #elif __GNUC__ 304 #elif __GNUC__
308 #define DART_PRETTY_FUNCTION __PRETTY_FUNCTION__ 305 #define DART_PRETTY_FUNCTION __PRETTY_FUNCTION__
309 #else 306 #else
310 #error Automatic compiler detection failed. 307 #error Automatic compiler detection failed.
311 #endif 308 #endif
312 309
313 #if !defined(TARGET_ARCH_MIPS) 310 #if !defined(TARGET_ARCH_MIPS) && !defined(TARGET_ARCH_ARM) && \
314 #if !defined(TARGET_ARCH_ARM) 311 !defined(TARGET_ARCH_X64) && !defined(TARGET_ARCH_IA32) && \
315 #if !defined(TARGET_ARCH_X64) 312 !defined(TARGET_ARCH_ARM64) && !defined(TARGET_ARCH_DBC)
316 #if !defined(TARGET_ARCH_IA32)
317 #if !defined(TARGET_ARCH_ARM64)
318 #if !defined(TARGET_ARCH_DBC)
319 // No target architecture specified pick the one matching the host architecture. 313 // No target architecture specified pick the one matching the host architecture.
320 #if defined(HOST_ARCH_MIPS) 314 #if defined(HOST_ARCH_MIPS)
321 #define TARGET_ARCH_MIPS 1 315 #define TARGET_ARCH_MIPS 1
322 #elif defined(HOST_ARCH_ARM) 316 #elif defined(HOST_ARCH_ARM)
323 #define TARGET_ARCH_ARM 1 317 #define TARGET_ARCH_ARM 1
324 #elif defined(HOST_ARCH_X64) 318 #elif defined(HOST_ARCH_X64)
325 #define TARGET_ARCH_X64 1 319 #define TARGET_ARCH_X64 1
326 #elif defined(HOST_ARCH_IA32) 320 #elif defined(HOST_ARCH_IA32)
327 #define TARGET_ARCH_IA32 1 321 #define TARGET_ARCH_IA32 1
328 #elif defined(HOST_ARCH_ARM64) 322 #elif defined(HOST_ARCH_ARM64)
329 #define TARGET_ARCH_ARM64 1 323 #define TARGET_ARCH_ARM64 1
330 #else 324 #else
331 #error Automatic target architecture detection failed. 325 #error Automatic target architecture detection failed.
332 #endif 326 #endif
333 #endif 327 #endif
334 #endif
335 #endif
336 #endif
337 #endif
338 #endif
339 328
340 // Verify that host and target architectures match, we cannot 329 // Verify that host and target architectures match, we cannot
341 // have a 64 bit Dart VM generating 32 bit code or vice-versa. 330 // have a 64 bit Dart VM generating 32 bit code or vice-versa.
342 #if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64) 331 #if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64)
343 #if !defined(ARCH_IS_64_BIT) 332 #if !defined(ARCH_IS_64_BIT)
344 #error Mismatched Host/Target architectures. 333 #error Mismatched Host/Target architectures.
345 #endif 334 #endif
346 #elif defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM) || \ 335 #elif defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM) || \
347 defined(TARGET_ARCH_MIPS) 336 defined(TARGET_ARCH_MIPS)
348 #if !defined(ARCH_IS_32_BIT) 337 #if !defined(ARCH_IS_32_BIT)
(...skipping 28 matching lines...) Expand all
377 #error Unknown architecture. 366 #error Unknown architecture.
378 #endif 367 #endif
379 368
380 // Disable background threads by default on armv5te. The relevant 369 // Disable background threads by default on armv5te. The relevant
381 // implementations are uniprocessors. 370 // implementations are uniprocessors.
382 #if !defined(TARGET_ARCH_ARM_5TE) 371 #if !defined(TARGET_ARCH_ARM_5TE)
383 #define ARCH_IS_MULTI_CORE 1 372 #define ARCH_IS_MULTI_CORE 1
384 #endif 373 #endif
385 374
386 375
387 #if defined(TARGET_ARCH_ARM) 376 #if !defined(TARGET_OS_ANDROID) && !defined(TARGET_OS_FUCHSIA) && \
388 #if defined(TARGET_ABI_IOS) && defined(TARGET_ABI_EABI) 377 !defined(TARGET_OS_MACOS_IOS) && !defined(TARGET_OS_LINUX) && \
389 #error Both TARGET_ABI_IOS and TARGET_ABI_EABI defined. 378 !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_WINDOWS)
390 #elif !defined(TARGET_ABI_IOS) && !defined(TARGET_ABI_EABI) 379 // No target OS specified; pick the one matching the host OS.
391 #if defined(HOST_OS_MAC) 380 #if defined(HOST_OS_ANDROID)
392 #define TARGET_ABI_IOS 1 381 #define TARGET_OS_ANDROID 1
382 #elif defined(HOST_OS_FUCHSIA)
383 #define TARGET_OS_FUCHSIA 1
384 #elif defined(HOST_OS_IOS)
385 #define TARGET_OS_MACOS 1
386 #define TARGET_OS_MACOS_IOS 1
387 #elif defined(HOST_OS_LINUX)
388 #define TARGET_OS_LINUX 1
389 #elif defined(HOST_OS_MACOS)
390 #define TARGET_OS_MACOS 1
391 #elif defined(HOST_OS_WINDOWS)
392 #define TARGET_OS_WINDOWS 1
393 #else 393 #else
394 #define TARGET_ABI_EABI 1 394 #error Automatic target OS detection failed.
395 #endif 395 #endif
396 #endif 396 #endif
397 #endif // TARGET_ARCH_ARM
398 397
399 398
400 // Short form printf format specifiers 399 // Short form printf format specifiers
401 #define Pd PRIdPTR 400 #define Pd PRIdPTR
402 #define Pu PRIuPTR 401 #define Pu PRIuPTR
403 #define Px PRIxPTR 402 #define Px PRIxPTR
404 #define Pd64 PRId64 403 #define Pd64 PRId64
405 #define Pu64 PRIu64 404 #define Pu64 PRIu64
406 #define Px64 PRIx64 405 #define Px64 PRIx64
407 406
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 // tag in the ICData and check it when recreating the flow graph in 709 // tag in the ICData and check it when recreating the flow graph in
711 // optimizing compiler. Enable it for other modes (product, release) if needed 710 // optimizing compiler. Enable it for other modes (product, release) if needed
712 // for debugging. 711 // for debugging.
713 #if defined(DEBUG) 712 #if defined(DEBUG)
714 #define TAG_IC_DATA 713 #define TAG_IC_DATA
715 #endif 714 #endif
716 715
717 } // namespace dart 716 } // namespace dart
718 717
719 #endif // RUNTIME_PLATFORM_GLOBALS_H_ 718 #endif // RUNTIME_PLATFORM_GLOBALS_H_
OLDNEW
« no previous file with comments | « runtime/BUILD.gn ('k') | runtime/vm/constants_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698