Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 #error Unknown architecture. | 374 #error Unknown architecture. |
| 378 #endif | 375 #endif |
| 379 | 376 |
| 380 // Disable background threads by default on armv5te. The relevant | 377 // Disable background threads by default on armv5te. The relevant |
| 381 // implementations are uniprocessors. | 378 // implementations are uniprocessors. |
| 382 #if !defined(TARGET_ARCH_ARM_5TE) | 379 #if !defined(TARGET_ARCH_ARM_5TE) |
| 383 #define ARCH_IS_MULTI_CORE 1 | 380 #define ARCH_IS_MULTI_CORE 1 |
| 384 #endif | 381 #endif |
| 385 | 382 |
| 386 | 383 |
| 387 #if defined(TARGET_ARCH_ARM) | 384 #if !defined(TARGET_OS_ANDROID) |
|
zra
2017/03/17 17:24:24
Why not:
#if !defined(...) && \
!defined(...)
rmacnak
2017/03/17 18:22:16
Copied idiom from the equivalent section for TARGE
| |
| 388 #if defined(TARGET_ABI_IOS) && defined(TARGET_ABI_EABI) | 385 #if !defined(TARGET_OS_FUCHSIA) |
| 389 #error Both TARGET_ABI_IOS and TARGET_ABI_EABI defined. | 386 #if !defined(TARGET_OS_IOS) |
| 390 #elif !defined(TARGET_ABI_IOS) && !defined(TARGET_ABI_EABI) | 387 #if !defined(TARGET_OS_LINUX) |
| 391 #if defined(HOST_OS_MAC) | 388 #if !defined(TARGET_OS_MACOS) |
| 392 #define TARGET_ABI_IOS 1 | 389 #if !defined(TARGET_OS_WINDOWS) |
| 390 // No target OS specified; pick the one matching the host OS. | |
| 391 #if defined(HOST_OS_ANDROID) | |
| 392 #define TARGET_OS_ANDROID 1 | |
| 393 #elif defined(HOST_OS_FUCHSIA) | |
| 394 #define TARGET_OS_FUCHSIA 1 | |
| 395 #elif defined(HOST_OS_IOS) | |
| 396 #define TARGET_OS_MACOS 1 | |
| 397 // Test for this #define by saying '#if TARGET_OS_IOS' rather than the usual | |
| 398 // '#if defined(TARGET_OS_IOS)'. TARGET_OS_IOS is defined to be 0 in | |
| 399 // XCode >= 7.0. See Issue #24453. | |
|
zra
2017/03/17 17:24:24
Can we use a different symbol? Maybe TARGET_OS_MAC
rmacnak
2017/03/17 18:22:16
Sure. TARGET_OS_MACOS_IOS seems like a good choice
| |
| 400 #define TARGET_OS_IOS 1 | |
| 401 #elif defined(HOST_OS_LINUX) | |
| 402 #define TARGET_OS_LINUX 1 | |
| 403 #elif defined(HOST_OS_MACOS) | |
| 404 #define TARGET_OS_MACOS 1 | |
| 405 #elif defined(HOST_OS_WINDOWS) | |
| 406 #define TARGET_OS_WINDOWS 1 | |
| 393 #else | 407 #else |
| 394 #define TARGET_ABI_EABI 1 | 408 #error Automatic target OS detection failed. |
| 395 #endif | 409 #endif |
| 396 #endif | 410 #endif |
| 397 #endif // TARGET_ARCH_ARM | 411 #endif |
| 412 #endif | |
| 413 #endif | |
| 414 #endif | |
| 415 #endif | |
| 416 | |
| 417 | |
| 418 // TARGET_OS_IOS is defined as 0 on macOS. Always define it so we can test | |
| 419 // uniformly. | |
| 420 #if !defined(TARGET_OS_IOS) | |
| 421 #define TARGET_OS_IOS 0 | |
| 422 #endif | |
| 398 | 423 |
| 399 | 424 |
| 400 // Short form printf format specifiers | 425 // Short form printf format specifiers |
| 401 #define Pd PRIdPTR | 426 #define Pd PRIdPTR |
| 402 #define Pu PRIuPTR | 427 #define Pu PRIuPTR |
| 403 #define Px PRIxPTR | 428 #define Px PRIxPTR |
| 404 #define Pd64 PRId64 | 429 #define Pd64 PRId64 |
| 405 #define Pu64 PRIu64 | 430 #define Pu64 PRIu64 |
| 406 #define Px64 PRIx64 | 431 #define Px64 PRIx64 |
| 407 | 432 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 710 // tag in the ICData and check it when recreating the flow graph in | 735 // 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 | 736 // optimizing compiler. Enable it for other modes (product, release) if needed |
| 712 // for debugging. | 737 // for debugging. |
| 713 #if defined(DEBUG) | 738 #if defined(DEBUG) |
| 714 #define TAG_IC_DATA | 739 #define TAG_IC_DATA |
| 715 #endif | 740 #endif |
| 716 | 741 |
| 717 } // namespace dart | 742 } // namespace dart |
| 718 | 743 |
| 719 #endif // RUNTIME_PLATFORM_GLOBALS_H_ | 744 #endif // RUNTIME_PLATFORM_GLOBALS_H_ |
| OLD | NEW |