diff options
author | jgm <jgm@google.com> | 2012-07-09 13:22:29 +0000 |
---|---|---|
committer | jgm <jgm@google.com> | 2012-07-09 13:22:29 +0000 |
commit | a1c4b46bc2c12ea7c61108f001a5b5eb4a8ccad0 (patch) | |
tree | d8cc16eaaf285ce91c88ab53a3f7cd19635221e6 | |
parent | a88c9a88e49e90ec414175543b2b7ff2f70866a7 (diff) | |
download | googletest-a1c4b46bc2c12ea7c61108f001a5b5eb4a8ccad0.tar.gz googletest-a1c4b46bc2c12ea7c61108f001a5b5eb4a8ccad0.tar.bz2 googletest-a1c4b46bc2c12ea7c61108f001a5b5eb4a8ccad0.zip |
added defines for iOS
-rw-r--r-- | include/gtest/internal/gtest-port.h | 12 | ||||
-rw-r--r-- | src/gtest.cc | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h index d4b69ce6..817ac8c5 100644 --- a/include/gtest/internal/gtest-port.h +++ b/include/gtest/internal/gtest-port.h @@ -90,6 +90,7 @@ // GTEST_OS_LINUX - Linux // GTEST_OS_LINUX_ANDROID - Google Android // GTEST_OS_MAC - Mac OS X +// GTEST_OS_IOS - iOS // GTEST_OS_NACL - Google Native Client (NaCl) // GTEST_OS_OPENBSD - OpenBSD // GTEST_OS_QNX - QNX @@ -195,6 +196,11 @@ # include <sys/stat.h> #endif // !_WIN32_WCE +#if defined __APPLE__ +# include <AvailabilityMacros.h> +# include <TargetConditionals.h> +#endif + #include <iostream> // NOLINT #include <sstream> // NOLINT #include <string> // NOLINT @@ -229,6 +235,9 @@ # endif // _WIN32_WCE #elif defined __APPLE__ # define GTEST_OS_MAC 1 +# if TARGET_OS_IPHONE +# define GTEST_OS_IOS 1 +# endif #elif defined __linux__ # define GTEST_OS_LINUX 1 # ifdef ANDROID @@ -553,7 +562,8 @@ // Google Test does not support death tests for VC 7.1 and earlier as // abort() in a VC 7.1 application compiled as GUI in debug config // pops up a dialog window that cannot be suppressed programmatically. -#if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ +#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ + (GTEST_OS_MAC && !GTEST_OS_IOS) || \ (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \ GTEST_OS_OPENBSD || GTEST_OS_QNX) diff --git a/src/gtest.cc b/src/gtest.cc index 35e1dbdf..3b5a28b0 100644 --- a/src/gtest.cc +++ b/src/gtest.cc @@ -2602,7 +2602,7 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) { va_list args; va_start(args, fmt); -#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS +#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || GTEST_OS_IOS const bool use_color = false; #else static const bool in_color_mode = |