gtest-port-arch.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. // The Google C++ Testing and Mocking Framework (Google Test)
  30. //
  31. // This header file defines the GTEST_OS_* macro.
  32. // It is separate from gtest-port.h so that custom/gtest-port.h can include it.
  33. #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
  34. #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
  35. // Determines the platform on which Google Test is compiled.
  36. #ifdef __CYGWIN__
  37. #define GTEST_OS_CYGWIN 1
  38. #elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
  39. #define GTEST_OS_WINDOWS_MINGW 1
  40. #define GTEST_OS_WINDOWS 1
  41. #elif defined _WIN32
  42. #define GTEST_OS_WINDOWS 1
  43. #ifdef _WIN32_WCE
  44. #define GTEST_OS_WINDOWS_MOBILE 1
  45. #elif defined(WINAPI_FAMILY)
  46. #include <winapifamily.h>
  47. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  48. #define GTEST_OS_WINDOWS_DESKTOP 1
  49. #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
  50. #define GTEST_OS_WINDOWS_PHONE 1
  51. #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  52. #define GTEST_OS_WINDOWS_RT 1
  53. #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)
  54. #define GTEST_OS_WINDOWS_PHONE 1
  55. #define GTEST_OS_WINDOWS_TV_TITLE 1
  56. #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_GAMES)
  57. #define GTEST_OS_WINDOWS_GAMES 1
  58. #else
  59. // WINAPI_FAMILY defined but no known partition matched.
  60. // Default to desktop.
  61. #define GTEST_OS_WINDOWS_DESKTOP 1
  62. #endif
  63. #else
  64. #define GTEST_OS_WINDOWS_DESKTOP 1
  65. #endif // _WIN32_WCE
  66. #elif defined __OS2__
  67. #define GTEST_OS_OS2 1
  68. #elif defined __APPLE__
  69. #define GTEST_OS_MAC 1
  70. #include <TargetConditionals.h>
  71. #if TARGET_OS_IPHONE
  72. #define GTEST_OS_IOS 1
  73. #endif
  74. #elif defined __DragonFly__
  75. #define GTEST_OS_DRAGONFLY 1
  76. #elif defined __FreeBSD__
  77. #define GTEST_OS_FREEBSD 1
  78. #elif defined __Fuchsia__
  79. #define GTEST_OS_FUCHSIA 1
  80. #elif defined(__GNU__)
  81. #define GTEST_OS_GNU_HURD 1
  82. #elif defined(__GLIBC__) && defined(__FreeBSD_kernel__)
  83. #define GTEST_OS_GNU_KFREEBSD 1
  84. #elif defined __linux__
  85. #define GTEST_OS_LINUX 1
  86. #if defined __ANDROID__
  87. #define GTEST_OS_LINUX_ANDROID 1
  88. #endif
  89. #elif defined __MVS__
  90. #define GTEST_OS_ZOS 1
  91. #elif defined(__sun) && defined(__SVR4)
  92. #define GTEST_OS_SOLARIS 1
  93. #elif defined(_AIX)
  94. #define GTEST_OS_AIX 1
  95. #elif defined(__hpux)
  96. #define GTEST_OS_HPUX 1
  97. #elif defined __native_client__
  98. #define GTEST_OS_NACL 1
  99. #elif defined __NetBSD__
  100. #define GTEST_OS_NETBSD 1
  101. #elif defined __OpenBSD__
  102. #define GTEST_OS_OPENBSD 1
  103. #elif defined __QNX__
  104. #define GTEST_OS_QNX 1
  105. #elif defined(__HAIKU__)
  106. #define GTEST_OS_HAIKU 1
  107. #elif defined ESP8266
  108. #define GTEST_OS_ESP8266 1
  109. #elif defined ESP32
  110. #define GTEST_OS_ESP32 1
  111. #elif defined(__XTENSA__)
  112. #define GTEST_OS_XTENSA 1
  113. #elif defined(__hexagon__)
  114. #define GTEST_OS_QURT 1
  115. #elif defined(CPU_QN9090) || defined(CPU_QN9090HN)
  116. #define GTEST_OS_NXP_QN9090 1
  117. #elif defined(NRF52)
  118. #define GTEST_OS_NRF52 1
  119. #endif // __CYGWIN__
  120. #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_