123 lines · c
1// Copyright 2015, Google Inc.2// All rights reserved.3//4// Redistribution and use in source and binary forms, with or without5// modification, are permitted provided that the following conditions are6// met:7//8// * Redistributions of source code must retain the above copyright9// notice, this list of conditions and the following disclaimer.10// * Redistributions in binary form must reproduce the above11// copyright notice, this list of conditions and the following disclaimer12// in the documentation and/or other materials provided with the13// distribution.14// * Neither the name of Google Inc. nor the names of its15// contributors may be used to endorse or promote products derived from16// this software without specific prior written permission.17//18// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR21// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT22// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT24// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,25// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY26// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT27// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.29 30// The Google C++ Testing and Mocking Framework (Google Test)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 35#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_36#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_37 38// Determines the platform on which Google Test is compiled.39#ifdef __CYGWIN__40#define GTEST_OS_CYGWIN 141#elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)42#define GTEST_OS_WINDOWS_MINGW 143#define GTEST_OS_WINDOWS 144#elif defined _WIN3245#define GTEST_OS_WINDOWS 146#ifdef _WIN32_WCE47#define GTEST_OS_WINDOWS_MOBILE 148#elif defined(WINAPI_FAMILY)49#include <winapifamily.h>50#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)51#define GTEST_OS_WINDOWS_DESKTOP 152#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)53#define GTEST_OS_WINDOWS_PHONE 154#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)55#define GTEST_OS_WINDOWS_RT 156#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)57#define GTEST_OS_WINDOWS_PHONE 158#define GTEST_OS_WINDOWS_TV_TITLE 159#else60// WINAPI_FAMILY defined but no known partition matched.61// Default to desktop.62#define GTEST_OS_WINDOWS_DESKTOP 163#endif64#else65#define GTEST_OS_WINDOWS_DESKTOP 166#endif // _WIN32_WCE67#elif defined __OS2__68#define GTEST_OS_OS2 169#elif defined __APPLE__70#define GTEST_OS_MAC 171#include <TargetConditionals.h>72#if TARGET_OS_IPHONE73#define GTEST_OS_IOS 174#endif75#elif defined __DragonFly__76#define GTEST_OS_DRAGONFLY 177#elif defined __FreeBSD__78#define GTEST_OS_FREEBSD 179#elif defined __Fuchsia__80#define GTEST_OS_FUCHSIA 181#elif defined(__GNU__)82#define GTEST_OS_GNU_HURD 183#elif defined(__GLIBC__) && defined(__FreeBSD_kernel__)84#define GTEST_OS_GNU_KFREEBSD 185#elif defined __linux__86#define GTEST_OS_LINUX 187#if defined __ANDROID__88#define GTEST_OS_LINUX_ANDROID 189#endif90#elif defined __MVS__91#define GTEST_OS_ZOS 192#elif defined(__sun) && defined(__SVR4)93#define GTEST_OS_SOLARIS 194#elif defined(_AIX)95#define GTEST_OS_AIX 196#elif defined(__hpux)97#define GTEST_OS_HPUX 198#elif defined __native_client__99#define GTEST_OS_NACL 1100#elif defined __NetBSD__101#define GTEST_OS_NETBSD 1102#elif defined __OpenBSD__103#define GTEST_OS_OPENBSD 1104#elif defined __QNX__105#define GTEST_OS_QNX 1106#elif defined(__HAIKU__)107#define GTEST_OS_HAIKU 1108#elif defined ESP8266109#define GTEST_OS_ESP8266 1110#elif defined ESP32111#define GTEST_OS_ESP32 1112#elif defined(__XTENSA__)113#define GTEST_OS_XTENSA 1114#elif defined(__hexagon__)115#define GTEST_OS_QURT 1116#elif defined(CPU_QN9090) || defined(CPU_QN9090HN)117#define GTEST_OS_NXP_QN9090 1118#elif defined(NRF52)119#define GTEST_OS_NRF52 1120#endif // __CYGWIN__121 122#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_123