This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] fix nanosleep check in GLIBCXX_ENABLE_LIBSTDCXX_TIME for darwin
- From: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: mikestump at comcast dot net, iain at codesourcery dot com, paolo dot carlini at oracle dot com
- Date: Sun, 7 Oct 2012 18:28:14 -0400
- Subject: [PATCH] fix nanosleep check in GLIBCXX_ENABLE_LIBSTDCXX_TIME for darwin
The --enable-libstdcxx-time=yes configure option fails to validate the
presence of a usable nanosleep() call on darwin. The fix is the trivial
change to the test used so that tp is declared as a struct for _POSIX_TIMERS <= 0.
Regression tested on x86_64-apple-darwin12. Okay for gcc trunk as well as
gcc-4_7-branch/gcc-4_6-branch/gcc-4_5-branch?
Jack
libstdc++-v3/
2012-10-07 Jack Howarth <howarth@bromo.med.uc.edu>
PR libstdc++/54847
* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Declare tp as struct for non-POSIX timers.
* configure: Regenerated.
Index: acinclude.m4
===================================================================
--- acinclude.m4 (revision 192186)
+++ acinclude.m4 (working copy)
@@ -1251,6 +1251,8 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME]
],
[#if _POSIX_TIMERS > 0
timespec tp;
+ #else
+ struct timespec tp;
#endif
nanosleep(&tp, 0);
], [ac_has_nanosleep=yes], [ac_has_nanosleep=no])