ipc/chromium: fix #if define() for kFreeBSD and Hurd
authorChristoph Goehre <chris@sigxcpu.org>
Wed, 31 Oct 2012 17:27:07 +0000 (13:27 -0400)
committerCarsten Schoenert <c.schoenert@t-online.de>
Thu, 12 Sep 2019 14:52:34 +0000 (15:52 +0100)
The kFreeBSD and Hurd platforms need some other macros to include
the correct needed headers.
Depended on this some minor changes to call the correct functions
also needed. Also the list of the cpp source file for the chromium
things needs to expanded.
The changes is an adoption of the previous dropped patch 'Fix
ipc/chromium on kFreeBSD and Hurd' from the version 17.

Gbp-Pq: Topic porting-kfreebsd-hurd
Gbp-Pq: Name ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch

ipc/chromium/src/base/platform_thread_posix.cc

index 2b3fed0370075dd14f58ecd8eabbd64c9e21b82e..5f52eebf9b3a285ca122d26c8cc081d728eb5f5c 100644 (file)
 #include <mach/mach.h>
 #elif defined(OS_NETBSD)
 #include <lwp.h>
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
 #include <sys/syscall.h>
 #include <sys/prctl.h>
+//#elif defined(OS_FREEBSD) && !defined(__FreeBSD_kernel__)
+//#include <sys/param.h>
+//#include <sys/thr.h>
 #endif
 
 #if !defined(OS_MACOSX)
 #include <unistd.h>
 #endif
 
-#if defined(OS_BSD) && !defined(OS_NETBSD) && !defined(__GLIBC__)
+#if !defined(OS_BSD) && !defined(NetBSD) && !defined(__FreeBSD_kernel__) && !defined(__GLIBC__)
 #include <pthread_np.h>
 #endif
 
@@ -99,7 +102,7 @@ void PlatformThread::SetName(const char* name) {
     // Note that glibc also has a 'pthread_setname_np' api, but it may not be
     // available everywhere and it's only benefit over using prctl directly is
     // that it can set the name of threads other than the current thread.
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
   prctl(PR_SET_NAME, reinterpret_cast<uintptr_t>(name), 0, 0, 0);
 #elif defined(OS_NETBSD)
   pthread_setname_np(pthread_self(), "%s", (void*)name);