Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2004-10-06 10:06:31


Jonathan Wakely wrote:

> On Wed, Oct 06, 2004 at 02:51:49PM +0200, Markus Sch?pflin wrote:
>
>>John, I attached a diffent patch for the file to this mail which fixes the
>>problem. First of all, the platform in question is Tru64 (not HP-UX).
>>
>>Next, when the file is included by the compiler, _GLIBCPP_HAVE_GTHR_DEFAULT
> ^^
> This should be _GLIBCXX_... not _GLIBCPP_...

Attached is a new patch. Hope this one is better. It now also checks
against _GLIBCXX_HAVE_GTHR_DEFAULT which seems to work ok.

> Without that check you will define _REENTRANT even when GCC was
> configured with --disable-threads (or its equivalents such as
> --enable-threads=single), which would be even worse than the current
> state. At least the current config headers can tell whether GCC 3.4
> _supports_ threads, it just can't tell whether it's _using_ threads.
>
> Since this issue only affects GCC 3.4 (previous versions did NOT define
> _REENTRANT unconditionally - which was a problem for OSF) if the check
> is for CXX not CPP then it automatically excludes previous (working)
> versions, as desired.
>
>>is _not_ defined. Therefore I changed the check to __osf__ && !_REENTRANT
>>to just unconditionally define _REENTRANT on Tru64.
>
> I still don't know why it isn't defined by the libstdc++ headers in that
> particular case, but is in the config_test.

Maybe I'll find some time tomorrow to track this down.

> I wish they'd just fix this in GCC :-(

Agreed.

Markus

Index: libstdcpp3.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/config/stdlib/libstdcpp3.hpp,v
retrieving revision 1.9
diff -u -r1.9 libstdcpp3.hpp
--- libstdcpp3.hpp 30 Jun 2004 10:17:00 -0000 1.9
+++ libstdcpp3.hpp 6 Oct 2004 15:02:34 -0000
@@ -22,6 +22,12 @@
 # define BOOST_NO_STD_WSTREAMBUF
 #endif
 
+#if defined(__osf__) && !defined(_REENTRANT) && defined(_GLIBCXX_HAVE_GTHR_DEFAULT)
+// GCC 3.4 on Tru64 forces the definition of _REENTRANT when any std lib header
+// file is included, therefore for consistency we define it here as well.
+# define _REENTRANT
+#endif
+
 #ifdef __GLIBCXX__ // gcc 3.4 and greater:
 # ifdef _GLIBCXX_HAVE_GTHR_DEFAULT
       //
@@ -43,5 +49,3 @@
 // support is useless.
 # undef BOOST_HAS_LONG_LONG
 #endif
-
-


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk