Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54408 - trunk/libs/thread/src/pthread
From: ghost_at_[hidden]
Date: 2009-06-27 05:22:41


Author: vladimir_prus
Date: 2009-06-27 05:22:41 EDT (Sat, 27 Jun 2009)
New Revision: 54408
URL: http://svn.boost.org/trac/boost/changeset/54408

Log:
Check _GNU_SOURCE before using get_nprocs.

The latter function is not POSIX, but a GNU extension and therefore
not available universally.

Text files modified:
   trunk/libs/thread/src/pthread/thread.cpp | 2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

Modified: trunk/libs/thread/src/pthread/thread.cpp
==============================================================================
--- trunk/libs/thread/src/pthread/thread.cpp (original)
+++ trunk/libs/thread/src/pthread/thread.cpp 2009-06-27 05:22:41 EDT (Sat, 27 Jun 2009)
@@ -380,7 +380,7 @@
     {
 #if defined(PTW32_VERSION) || defined(__hpux)
         return pthread_num_processors_np();
-#elif defined(__linux__)
+#elif defined(_GNU_SOURCE)
         return get_nprocs();
 #elif defined(__APPLE__) || defined(__FreeBSD__)
         int count;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk