Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 1 | // Copyright 2015, Google Inc. |
| 2 | // All rights reserved. |
| 3 | // |
| 4 | // Redistribution and use in source and binary forms, with or without |
| 5 | // modification, are permitted provided that the following conditions are |
| 6 | // met: |
| 7 | // |
| 8 | // * Redistributions of source code must retain the above copyright |
| 9 | // notice, this list of conditions and the following disclaimer. |
| 10 | // * Redistributions in binary form must reproduce the above |
| 11 | // copyright notice, this list of conditions and the following disclaimer |
| 12 | // in the documentation and/or other materials provided with the |
| 13 | // distribution. |
| 14 | // * Neither the name of Google Inc. nor the names of its |
| 15 | // contributors may be used to endorse or promote products derived from |
| 16 | // this software without specific prior written permission. |
| 17 | // |
| 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | // |
Austin Schuh | 889ac43 | 2018-10-29 22:57:02 -0700 | [diff] [blame] | 30 | // The Google C++ Testing and Mocking Framework (Google Test) |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 31 | // |
| 32 | // This header file defines the GTEST_OS_* macro. |
| 33 | // It is separate from gtest-port.h so that custom/gtest-port.h can include it. |
| 34 | |
James Kuszmaul | e2f1529 | 2021-05-10 22:37:32 -0700 | [diff] [blame^] | 35 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_ |
| 36 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_ |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 37 | |
| 38 | // Determines the platform on which Google Test is compiled. |
| 39 | #ifdef __CYGWIN__ |
| 40 | # define GTEST_OS_CYGWIN 1 |
James Kuszmaul | e2f1529 | 2021-05-10 22:37:32 -0700 | [diff] [blame^] | 41 | # elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__) |
| 42 | # define GTEST_OS_WINDOWS_MINGW 1 |
| 43 | # define GTEST_OS_WINDOWS 1 |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 44 | #elif defined _WIN32 |
| 45 | # define GTEST_OS_WINDOWS 1 |
| 46 | # ifdef _WIN32_WCE |
| 47 | # define GTEST_OS_WINDOWS_MOBILE 1 |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 48 | # elif defined(WINAPI_FAMILY) |
| 49 | # include <winapifamily.h> |
| 50 | # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) |
| 51 | # define GTEST_OS_WINDOWS_DESKTOP 1 |
| 52 | # elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) |
| 53 | # define GTEST_OS_WINDOWS_PHONE 1 |
| 54 | # elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) |
| 55 | # define GTEST_OS_WINDOWS_RT 1 |
Austin Schuh | 889ac43 | 2018-10-29 22:57:02 -0700 | [diff] [blame] | 56 | # elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE) |
| 57 | # define GTEST_OS_WINDOWS_PHONE 1 |
| 58 | # define GTEST_OS_WINDOWS_TV_TITLE 1 |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 59 | # else |
| 60 | // WINAPI_FAMILY defined but no known partition matched. |
| 61 | // Default to desktop. |
| 62 | # define GTEST_OS_WINDOWS_DESKTOP 1 |
| 63 | # endif |
| 64 | # else |
| 65 | # define GTEST_OS_WINDOWS_DESKTOP 1 |
| 66 | # endif // _WIN32_WCE |
James Kuszmaul | e2f1529 | 2021-05-10 22:37:32 -0700 | [diff] [blame^] | 67 | #elif defined __OS2__ |
| 68 | # define GTEST_OS_OS2 1 |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 69 | #elif defined __APPLE__ |
| 70 | # define GTEST_OS_MAC 1 |
James Kuszmaul | e2f1529 | 2021-05-10 22:37:32 -0700 | [diff] [blame^] | 71 | # include <TargetConditionals.h> |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 72 | # if TARGET_OS_IPHONE |
| 73 | # define GTEST_OS_IOS 1 |
| 74 | # endif |
James Kuszmaul | e2f1529 | 2021-05-10 22:37:32 -0700 | [diff] [blame^] | 75 | #elif defined __DragonFly__ |
| 76 | # define GTEST_OS_DRAGONFLY 1 |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 77 | #elif defined __FreeBSD__ |
| 78 | # define GTEST_OS_FREEBSD 1 |
Austin Schuh | 889ac43 | 2018-10-29 22:57:02 -0700 | [diff] [blame] | 79 | #elif defined __Fuchsia__ |
| 80 | # define GTEST_OS_FUCHSIA 1 |
James Kuszmaul | e2f1529 | 2021-05-10 22:37:32 -0700 | [diff] [blame^] | 81 | #elif defined(__GLIBC__) && defined(__FreeBSD_kernel__) |
| 82 | # define GTEST_OS_GNU_KFREEBSD 1 |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 83 | #elif defined __linux__ |
| 84 | # define GTEST_OS_LINUX 1 |
| 85 | # if defined __ANDROID__ |
| 86 | # define GTEST_OS_LINUX_ANDROID 1 |
| 87 | # endif |
| 88 | #elif defined __MVS__ |
| 89 | # define GTEST_OS_ZOS 1 |
| 90 | #elif defined(__sun) && defined(__SVR4) |
| 91 | # define GTEST_OS_SOLARIS 1 |
| 92 | #elif defined(_AIX) |
| 93 | # define GTEST_OS_AIX 1 |
| 94 | #elif defined(__hpux) |
| 95 | # define GTEST_OS_HPUX 1 |
| 96 | #elif defined __native_client__ |
| 97 | # define GTEST_OS_NACL 1 |
Austin Schuh | 889ac43 | 2018-10-29 22:57:02 -0700 | [diff] [blame] | 98 | #elif defined __NetBSD__ |
| 99 | # define GTEST_OS_NETBSD 1 |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 100 | #elif defined __OpenBSD__ |
| 101 | # define GTEST_OS_OPENBSD 1 |
| 102 | #elif defined __QNX__ |
| 103 | # define GTEST_OS_QNX 1 |
James Kuszmaul | e2f1529 | 2021-05-10 22:37:32 -0700 | [diff] [blame^] | 104 | #elif defined(__HAIKU__) |
| 105 | #define GTEST_OS_HAIKU 1 |
| 106 | #elif defined ESP8266 |
| 107 | #define GTEST_OS_ESP8266 1 |
| 108 | #elif defined ESP32 |
| 109 | #define GTEST_OS_ESP32 1 |
| 110 | #elif defined(__XTENSA__) |
| 111 | #define GTEST_OS_XTENSA 1 |
Austin Schuh | 0cbef62 | 2015-09-06 17:34:52 -0700 | [diff] [blame] | 112 | #endif // __CYGWIN__ |
| 113 | |
James Kuszmaul | e2f1529 | 2021-05-10 22:37:32 -0700 | [diff] [blame^] | 114 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_ |