Use #if TARGET_OS_IOS instead of #ifdef TARGET_OS_IOS.

New versions of the OS X SDK always define TARGET_OS_IOS, as 0 or 1.

BUG=https://github.com/dart-lang/sdk/issues/24501
BUG=https://github.com/dart-lang/sdk/issues/24453
R=iposva@google.com

Review URL: https://codereview.chromium.org/1388973002 .
This commit is contained in:
William Hesse 2015-10-12 12:38:10 +02:00
parent 5c04f8a13c
commit e6b85bb28c
5 changed files with 16 additions and 16 deletions

View file

@ -7,7 +7,7 @@
#include "bin/file_system_watcher.h"
#if !defined(TARGET_OS_IOS)
#if !TARGET_OS_IOS
#include <errno.h> // NOLINT
#include <fcntl.h> // NOLINT
@ -394,7 +394,7 @@ Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) {
} // namespace bin
} // namespace dart
#else // !defined(TARGET_OS_IOS)
#else // !TARGET_OS_IOS
namespace dart {
namespace bin {
@ -432,6 +432,6 @@ intptr_t FileSystemWatcher::WatchPath(intptr_t id,
} // namespace bin
} // namespace dart
#endif // !defined(TARGET_OS_IOS)
#endif // !TARGET_OS_IOS
#endif // defined(TARGET_OS_MACOS)

View file

@ -12,9 +12,9 @@
#include "bin/file.h"
#include "bin/platform.h"
#if !defined(TARGET_OS_IOS)
#if !TARGET_OS_IOS
#include <crt_externs.h> // NOLINT
#endif // !defined(TARGET_OS_IOS)
#endif // !TARGET_OS_IOS
#include <signal.h> // NOLINT
#include <string.h> // NOLINT
#include <unistd.h> // NOLINT
@ -68,7 +68,7 @@ bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
char** Platform::Environment(intptr_t* count) {
#if defined(TARGET_OS_IOS)
#if TARGET_OS_IOS
// TODO(iposva): On Mac (desktop), _NSGetEnviron() is used to access the
// environ from shared libraries or bundles. This is present in crt_externs.h
// which is unavailable on iOS. On iOS, everything is statically linked for

View file

@ -7,7 +7,7 @@
#include "bin/process.h"
#if !defined(TARGET_OS_IOS)
#if !TARGET_OS_IOS
#include <crt_externs.h> // NOLINT
#endif
#include <errno.h> // NOLINT
@ -451,7 +451,7 @@ class ProcessStarter {
ReportChildError();
}
#if !defined(TARGET_OS_IOS)
#if !TARGET_OS_IOS
if (program_environment_ != NULL) {
// On MacOS you have to do a bit of magic to get to the
// environment strings.

View file

@ -94,8 +94,8 @@
// TODO(iposva): Rename TARGET_OS_MACOS to TARGET_OS_MAC to inherit
// the value defined in TargetConditionals.h
#define TARGET_OS_MACOS 1
#if TARGET_OS_IPHONE
#define TARGET_OS_IOS
#if TARGET_OS_IPHONE && !defined(TARGET_OS_IOS)
#define TARGET_OS_IOS 1
#endif
#elif defined(_WIN32)
@ -279,17 +279,17 @@ typedef simd128_value_t fpu_register_t;
#elif defined(TARGET_ARCH_X64)
// No simulator used.
#elif defined(TARGET_ARCH_ARM)
#if !defined(HOST_ARCH_ARM) || defined(TARGET_OS_IOS)
#if !defined(HOST_ARCH_ARM) || TARGET_OS_IOS
#define USING_SIMULATOR 1
#endif
#elif defined(TARGET_ARCH_ARM64)
#if !defined(HOST_ARCH_ARM64) || defined(TARGET_OS_IOS)
#if !defined(HOST_ARCH_ARM64) || TARGET_OS_IOS
#define USING_SIMULATOR 1
#endif
#elif defined(TARGET_ARCH_MIPS)
#if !defined(HOST_ARCH_MIPS) || defined(TARGET_OS_IOS)
#if !defined(HOST_ARCH_MIPS) || TARGET_OS_IOS
#define USING_SIMULATOR 1
#endif

View file

@ -15,7 +15,7 @@
#include <sys/time.h> // NOLINT
#include <sys/resource.h> // NOLINT
#include <unistd.h> // NOLINT
#if defined(TARGET_OS_IOS)
#if TARGET_OS_IOS
#include <sys/sysctl.h>
#endif
@ -86,7 +86,7 @@ int64_t OS::GetCurrentTimeMicros() {
int64_t OS::GetCurrentTraceMicros() {
#if defined(TARGET_OS_IOS)
#if TARGET_OS_IOS
// On iOS mach_absolute_time stops while the device is sleeping. Instead use
// now - KERN_BOOTTIME to get a time difference that is not impacted by clock
// changes. KERN_BOOTTIME will be updated by the system whenever the system
@ -118,7 +118,7 @@ int64_t OS::GetCurrentTraceMicros() {
result *= timebase_info.numer;
result /= timebase_info.denom;
return result;
#endif // defined(TARGET_OS_IOS)
#endif // TARGET_OS_IOS
}