Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2002-09-01 10:39:37


On Sun, 01 Sep 2002 13:38:27 +0200, Gennaro Prota
<gennaro_prota_at_[hidden]> wrote:

>On Sun, 1 Sep 2002 11:41:28 +0100, "John Maddock"
><jm_at_[hidden]> wrote:
>
>[..]
>>
>>It's a namespace handling bug, the code that gets triggered in this case is
>>(at least I think I've got this right):
>>
>>#if !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) &&
>>defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
>># define BOOST_NO_STD_LOCALE
>>#endif
>>
>>the problem is that things like:
>>
>>const std::ctype<char>* pct;
>>
>>don't compile !!
>
>But in my situation they compile. And, since I'm using STLport's
>iostreams, I expected the macro _STLP_OWN_IOSTREAMS to be defined.
>
>I have checked the STLport docs and it seems that the "official" macro
>is _STLP_NO_OWN_IOSTREAMS (with the "no" inside), not
>_STLP_OWN_IOSTREAMS. Of course one would expect that when either is
>defined the other isn't, but in my case they are both undefined. I
>don't know if this intentional or a problem in the STLport code.
>
>Anyhow, considering that only _STLP_NO_OWN_IOSTREAMS is clearly
>documented, isn't just that the above code from config/suffix.hpp
>should be written as:
>
>#if defined(_STLP_NO_OWN_IOSTREAMS) // <---
> && defined(_STLP_USE_NAMESPACES) &&
>defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
># define BOOST_NO_STD_LOCALE
>#endif
>
>
>?

I think I've found the problem: the code that gets triggered is not
the one that you pointed out, but the code (#if/#endif) immediately
following. Here are both snippets:

//
// If the streams are not native, and we have a "using ::x" compiler
bug
// then the io stream facets are not available in namespace std::
//
#if !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) &&
defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
# define BOOST_NO_STD_LOCALE
#endif
#if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_NAMESPACES)
&& defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
# define BOOST_NO_STD_LOCALE
#endif

In fact, both me and you were wrong. The condition of the first #if
evaluates to false, but the condition of the second #if to true:
__SGI_STL_OWN_IOSTREAMS is not defined (a search in all the STLport
files has found one occurrence of __SGI_STL_OWN_IOSTREAMS and it's in
the change log ChangeLog-4.0. No #defines). The fix should be trivial.

As far as I understand it (I don't know the whole story about the
original SGI implementation and the STLport) the second test should
concern the original SGI only, shouldn't it? Note BTW that it tests
for __STL_xx and not __STLP_xx. If so, shouldn't it be in sgi.hpp?

Sorry if I'm just confusing things, but it's better asking than
suggesting erroneous corrections, I think.

Genny.


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