This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libstdc++-v3 PATCH/RFA] Protect use of optional POSIX features


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]