Changeset View
Changeset View
Standalone View
Standalone View
devel/googletest/files/patch-bsd-defines
o Add DragonFly and GNU/kFreeBSD support | o Add DragonFly and GNU/kFreeBSD support | ||||
o Implement GetThreadCount() for BSDs | o Implement GetThreadCount() for BSDs | ||||
--- include/gtest/internal/gtest-port-arch.h.orig 2017-09-23 23:21:02 UTC | --- googletest/include/gtest/internal/gtest-port-arch.h.orig 2017-09-23 23:21:02 UTC | ||||
+++ include/gtest/internal/gtest-port-arch.h | +++ googletest/include/gtest/internal/gtest-port-arch.h | ||||
@@ -67,6 +67,10 @@ | @@ -67,6 +67,10 @@ | ||||
# if TARGET_OS_IPHONE | # if TARGET_OS_IPHONE | ||||
# define GTEST_OS_IOS 1 | # define GTEST_OS_IOS 1 | ||||
# endif | # endif | ||||
+#elif defined __DragonFly__ | +#elif defined __DragonFly__ | ||||
+# define GTEST_OS_DRAGONFLY 1 | +# define GTEST_OS_DRAGONFLY 1 | ||||
+#elif defined(__GLIBC__) && defined(__FreeBSD_kernel__) | +#elif defined(__GLIBC__) && defined(__FreeBSD_kernel__) | ||||
+# define GTEST_OS_GNU_KFREEBSD 1 | +# define GTEST_OS_GNU_KFREEBSD 1 | ||||
#elif defined __FreeBSD__ | #elif defined __FreeBSD__ | ||||
# define GTEST_OS_FREEBSD 1 | # define GTEST_OS_FREEBSD 1 | ||||
#elif defined __Fuchsia__ | #elif defined __Fuchsia__ | ||||
--- include/gtest/internal/gtest-port.h.orig 2018-08-31 15:21:57 UTC | --- googletest/include/gtest/internal/gtest-port.h.orig 2018-08-31 15:21:57 UTC | ||||
+++ include/gtest/internal/gtest-port.h | +++ googletest/include/gtest/internal/gtest-port.h | ||||
@@ -125,7 +125,9 @@ | @@ -125,7 +125,9 @@ | ||||
// | // | ||||
// GTEST_OS_AIX - IBM AIX | // GTEST_OS_AIX - IBM AIX | ||||
// GTEST_OS_CYGWIN - Cygwin | // GTEST_OS_CYGWIN - Cygwin | ||||
+// GTEST_OS_DRAGONFLY - DragonFly | +// GTEST_OS_DRAGONFLY - DragonFly | ||||
// GTEST_OS_FREEBSD - FreeBSD | // GTEST_OS_FREEBSD - FreeBSD | ||||
+// GTEST_OS_GNU_KFREEBSD - GNU/kFreeBSD | +// GTEST_OS_GNU_KFREEBSD - GNU/kFreeBSD | ||||
// GTEST_OS_FUCHSIA - Fuchsia | // GTEST_OS_FUCHSIA - Fuchsia | ||||
Show All 22 Lines | |||||
// Determines whether test results can be streamed to a socket. | // Determines whether test results can be streamed to a socket. | ||||
-#if GTEST_OS_LINUX | -#if GTEST_OS_LINUX | ||||
+#if GTEST_OS_LINUX || GTEST_OS_GNU_KFREEBSD || GTEST_OS_DRAGONFLY || \ | +#if GTEST_OS_LINUX || GTEST_OS_GNU_KFREEBSD || GTEST_OS_DRAGONFLY || \ | ||||
+ GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_OPENBSD | + GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_OPENBSD | ||||
# define GTEST_CAN_STREAM_RESULTS_ 1 | # define GTEST_CAN_STREAM_RESULTS_ 1 | ||||
#endif | #endif | ||||
--- src/gtest-port.cc.orig 2017-09-23 23:21:02 UTC | --- googletest/src/gtest-port.cc.orig 2017-09-23 23:21:02 UTC | ||||
+++ src/gtest-port.cc | +++ googletest/src/gtest-port.cc | ||||
@@ -52,6 +52,14 @@ | @@ -52,6 +52,14 @@ | ||||
# include <mach/vm_map.h> | # include <mach/vm_map.h> | ||||
#endif // GTEST_OS_MAC | #endif // GTEST_OS_MAC | ||||
+#if GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \ | +#if GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \ | ||||
+ GTEST_OS_NETBSD || GTEST_OS_OPENBSD | + GTEST_OS_NETBSD || GTEST_OS_OPENBSD | ||||
+# include <sys/sysctl.h> | +# include <sys/sysctl.h> | ||||
+# if GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD | +# if GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
+ if (info[i].p_tid != -1) | + if (info[i].p_tid != -1) | ||||
+ nthreads++; | + nthreads++; | ||||
+ } | + } | ||||
+ return nthreads; | + return nthreads; | ||||
+} | +} | ||||
#elif GTEST_OS_QNX | #elif GTEST_OS_QNX | ||||
// Returns the number of threads running in the process, or 0 to indicate that | // Returns the number of threads running in the process, or 0 to indicate that | ||||
--- src/gtest.cc.orig 2017-09-23 23:21:02 UTC | --- googletest/src/gtest.cc.orig 2017-09-23 23:21:02 UTC | ||||
+++ src/gtest.cc | +++ googletest/src/gtest.cc | ||||
@@ -127,7 +127,7 @@ | @@ -127,7 +127,7 @@ | ||||
#endif | #endif | ||||
#if GTEST_CAN_STREAM_RESULTS_ | #if GTEST_CAN_STREAM_RESULTS_ | ||||
-# include <arpa/inet.h> // NOLINT | -# include <arpa/inet.h> // NOLINT | ||||
+# include <sys/socket.h> // NOLINT | +# include <sys/socket.h> // NOLINT | ||||
# include <netdb.h> // NOLINT | # include <netdb.h> // NOLINT | ||||
# include <sys/socket.h> // NOLINT | # include <sys/socket.h> // NOLINT | ||||
# include <sys/types.h> // NOLINT | # include <sys/types.h> // NOLINT | ||||
--- test/googletest-port-test.cc.orig 2018-08-31 15:21:57 UTC | --- googletest/test/googletest-port-test.cc.orig 2018-08-31 15:21:57 UTC | ||||
+++ test/googletest-port-test.cc | +++ googletest/test/googletest-port-test.cc | ||||
@@ -293,7 +293,9 @@ TEST(FormatCompilerIndependentFileLocationTest, Format | @@ -293,7 +293,9 @@ TEST(FormatCompilerIndependentFileLocationTest, Format | ||||
EXPECT_EQ("unknown file", FormatCompilerIndependentFileLocation(NULL, -1)); | EXPECT_EQ("unknown file", FormatCompilerIndependentFileLocation(NULL, -1)); | ||||
} | } | ||||
-#if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA | -#if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA | ||||
+#if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA || \ | +#if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA || \ | ||||
+ GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \ | + GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \ | ||||
+ GTEST_OS_NETBSD || GTEST_OS_OPENBSD | + GTEST_OS_NETBSD || GTEST_OS_OPENBSD | ||||
void* ThreadFunc(void* data) { | void* ThreadFunc(void* data) { | ||||
internal::Mutex* mutex = static_cast<internal::Mutex*>(data); | internal::Mutex* mutex = static_cast<internal::Mutex*>(data); | ||||
mutex->Lock(); | mutex->Lock(); |