From 2228d01073a34d20ed53beabd80c84360734f173 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Wed, 19 Feb 2014 15:18:30 +0000 Subject: [PATCH] Support GTest for FreeBSD platforms (9.x) Patch by Viktor Kutuzov! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201683 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/unittest/googletest/README.LLVM | 1 + .../googletest/include/gtest/internal/gtest-port.h | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/unittest/googletest/README.LLVM b/utils/unittest/googletest/README.LLVM index 1a6f0f59f1d..16bfffd8d5e 100644 --- a/utils/unittest/googletest/README.LLVM +++ b/utils/unittest/googletest/README.LLVM @@ -16,6 +16,7 @@ $ rm -f src/gtest_main.cc $ mv COPYING LICENSE.TXT Modified as follows: +* Added support for FreeBSD. * To GTestStreamToHelper in include/gtest/internal/gtest-internal.h, added the ability to stream with raw_os_ostream. * To refresh Haiku support in include/gtest/internal/gtest-port.h, diff --git a/utils/unittest/googletest/include/gtest/internal/gtest-port.h b/utils/unittest/googletest/include/gtest/internal/gtest-port.h index 32fd9c65bfe..f5bfd4e1d2e 100644 --- a/utils/unittest/googletest/include/gtest/internal/gtest-port.h +++ b/utils/unittest/googletest/include/gtest/internal/gtest-port.h @@ -86,6 +86,7 @@ // the given platform; otherwise undefined): // GTEST_OS_AIX - IBM AIX // GTEST_OS_CYGWIN - Cygwin +// GTEST_OS_FREEBSD - FreeBSD // GTEST_OS_HAIKU - Haiku // GTEST_OS_HPUX - HP-UX // GTEST_OS_LINUX - Linux @@ -228,6 +229,8 @@ # endif // _WIN32_WCE #elif defined __APPLE__ # define GTEST_OS_MAC 1 +#elif defined __FreeBSD__ +# define GTEST_OS_FREEBSD 1 #elif defined __linux__ # define GTEST_OS_LINUX 1 # if defined(ANDROID) || defined(__ANDROID__) @@ -421,7 +424,8 @@ // // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 // to your compiler flags. -# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX) +# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || \ + GTEST_OS_HPUX || GTEST_OS_FREEBSD) #endif // GTEST_HAS_PTHREAD #if GTEST_HAS_PTHREAD @@ -545,7 +549,8 @@ // pops up a dialog window that cannot be suppressed programmatically. #if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ - GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX) + GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || \ + GTEST_OS_HPUX || GTEST_OS_FREEBSD) # define GTEST_HAS_DEATH_TEST 1 # include // NOLINT #endif