This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libstdc++-v3 PATCH/RFA] Protect use of optional POSIX features
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: thorpej at wasabisystems dot com
- Date: Mon, 28 Oct 2002 18:25:32 -0600 (CST)
- Subject: Re: [libstdc++-v3 PATCH/RFA] Protect use of optional POSIX features
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
> In a similar vein to my recent patch to gcc/gthr-posix.h, this protects
> use of features from the optional Thread Priority Scheduling group in
> the "pthread5" test.
> * testsuite/thread/pthread5.cc: Include <unistd.h>.
> (main): Only use pthread_attr_setscope if
> _POSIX_THREAD_PRIORITY_SCHEDULING is defined.
Jason, I buy your argument that <unistd.h> must exist in this case.
However, we do an autoconf test for this exact header presumably for
some (perhaps now invalid) reason. Thus, I will not answer the
question of whether it is strictly required to be guarded but I will
approved it with that extra guard wrapping.
FYI, for C++ test cases that have included at least one libstdc++-v3
header file beforehand, it is OK to guard the inclusion of <unistd.h>.
However, to be namespace-save the wrapper symbol is
_GLIBCPP_HAVE_UNISTD_H not HAVE_UNISTD_H.
Now, since doing one thing verses the other will not actually affect
bootstrap-ability, I will also approve this test case patch without my
suggested change. ;-)
Thank you for these patches. You may place the libstdc++-v3 test
suite patches on branch as well as mainline without further approval.
Regards,
Loren