From f8a5c76f0d38328b15d369a08de272c0efbe3181 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Thu, 29 Jan 2015 15:13:18 +0530 Subject: [PATCH 1/2] Check for _POSIX_TIMEOUTS more neatly. The present code do twice checking using "&&" operator. Making the check more neat. Refer : https://sourceware.org/git/?p=glibc.git;a=blob;f=include/features.h 258 #if (_POSIX_C_SOURCE - 0) >= 200112L Also Refer : http://man7.org/linux/man-pages/man7/feature_test_macros.7.html for explanation of feature test macros. --- include/boost/thread/pthread/mutex.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/thread/pthread/mutex.hpp b/include/boost/thread/pthread/mutex.hpp index 3e9af2a83..601c87e47 100644 --- a/include/boost/thread/pthread/mutex.hpp +++ b/include/boost/thread/pthread/mutex.hpp @@ -27,7 +27,7 @@ #include #ifdef _POSIX_TIMEOUTS -#if _POSIX_TIMEOUTS >= 0 && _POSIX_TIMEOUTS>=200112L +#if (_POSIX_TIMEOUTS - 0) >= 200112L #ifndef BOOST_PTHREAD_HAS_TIMEDLOCK #define BOOST_PTHREAD_HAS_TIMEDLOCK #endif From 6b3af1c9270c1cc3d3b1aa69e9b33c94729212b1 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Thu, 29 Jan 2015 15:19:34 +0530 Subject: [PATCH 2/2] Check for _POSIX_TIMEOUTS more neatly. --- include/boost/thread/pthread/recursive_mutex.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/thread/pthread/recursive_mutex.hpp b/include/boost/thread/pthread/recursive_mutex.hpp index 9330d77de..09d0f10a6 100644 --- a/include/boost/thread/pthread/recursive_mutex.hpp +++ b/include/boost/thread/pthread/recursive_mutex.hpp @@ -28,7 +28,7 @@ #include #ifdef _POSIX_TIMEOUTS -#if _POSIX_TIMEOUTS >= 0 && _POSIX_TIMEOUTS>=200112L +#if (_POSIX_TIMEOUTS - 0) >= 200112L #ifndef BOOST_PTHREAD_HAS_TIMEDLOCK #define BOOST_PTHREAD_HAS_TIMEDLOCK #endif