|
Boost : |
From: Thomas Matelich (matelich_at_[hidden])
Date: 2005-06-20 16:54:48
On 6/20/05, Toon Knapen <toon.knapen_at_[hidden]> wrote:
> Caleb Epstein wrote:
>
> > Well, there is code in
> > libs/filesystem/src/operations_posix_windows.cpp that attempts to
> > detect if it is being compiled with multi-threading enabled:
> >
> > # if defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
> > && defined(_SC_THREAD_SAFE_FUNCTIONS) \
> > && (_POSIX_THREAD_SAFE_FUNCTIONS+0 >= 0)
> >
> > Presumably aCC sets these macros incorrectly, or this code is not
> > correct. Maybe the check should be for >0?
>
>
> Since somebody suggested that _REENTRANT is defined on HP when the '-mt'
> flag is used, what about only adding adding following to this #if
>
> # if defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
> && defined(_SC_THREAD_SAFE_FUNCTIONS) \
> && (_POSIX_THREAD_SAFE_FUNCTIONS+0 >= 0)
> || (defined(__HP_aCC) && defined(_REENTRANT))
>
I don't use boost build, but I thought the existing ifdef block seemed
like it should work. I don't know much about HPUX on Itanium, but I
went grepping on my HP 11i box, and found the
_POSIX_THREAD_SAFE_FUNCTIONS define in /usr/include/sys/unistd.h.
Then I remembered that to use the new posix friendly APIs on 11i, you
need a -D_POSIX_C_SOURCE=199506L. I'd bet that if you added that to
your build, things would work a lot more nicely. I think that define
is only contra-indicated if you're still trying to use CMA threads
(which is not a good idea).
If you do end up needing a modification of the define block above, I'd
recommend __hpux rather than __HP_aCC since this is a platform issue
rather than a compiler issue.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk