From 1dfd977ec43370da6931b11a8d0469792c8ebc36 Mon Sep 17 00:00:00 2001
From: Rogier-5 <Rogier-5@users.noreply.github.com>
Date: Mon, 4 Jul 2016 21:00:57 +0200
Subject: Fix & make linux conditionals uniform (#4278)

The source used a hodge-podge of different combinations of different
macros to check for linux: 'linux', '__linux', '__linux__'.

As '__linux__' is standard (Posix), and the others are not, the source
now uniformly uses __linux__. If either linux or __linux are defined,
it is made sure that __linux__ is defined as well.
---
 src/threading/thread.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/threading')

diff --git a/src/threading/thread.cpp b/src/threading/thread.cpp
index 5161a6c01..0cd536795 100644
--- a/src/threading/thread.cpp
+++ b/src/threading/thread.cpp
@@ -54,7 +54,7 @@ DEALINGS IN THE SOFTWARE.
 
 
 // for setName
-#if defined(linux) || defined(__linux)
+#if defined(__linux__)
 	#include <sys/prctl.h>
 #elif defined(__FreeBSD__) || defined(__OpenBSD__)
 	#include <pthread_np.h>
@@ -70,7 +70,7 @@ DEALINGS IN THE SOFTWARE.
 // for bindToProcessor
 #if __FreeBSD_version >= 702106
 	typedef cpuset_t cpu_set_t;
-#elif defined(__linux) || defined(linux)
+#elif defined(__linux__)
 	#include <sched.h>
 #elif defined(__sun) || defined(sun)
 	#include <sys/types.h>
@@ -261,7 +261,7 @@ DWORD WINAPI Thread::threadProc(LPVOID param)
 
 void Thread::setName(const std::string &name)
 {
-#if defined(linux) || defined(__linux)
+#if defined(__linux__)
 
 	// It would be cleaner to do this with pthread_setname_np,
 	// which was added to glibc in version 2.12, but some major
@@ -363,7 +363,7 @@ bool Thread::bindToProcessor(unsigned int proc_number)
 
 	return SetThreadAffinityMask(getThreadHandle(), 1 << proc_number);
 
-#elif __FreeBSD_version >= 702106 || defined(__linux) || defined(linux)
+#elif __FreeBSD_version >= 702106 || defined(__linux__)
 
 	cpu_set_t cpuset;
 
-- 
cgit v1.2.3