fix nanosleep check in GLIBCXX_ENABLE_LIBSTDCXX_TIME for darwin

Submitted by Jack Howarth on Oct. 7, 2012, 10:28 p.m.


Message ID
State New
Headers show

Commit Message

Jack Howarth Oct. 7, 2012, 10:28 p.m.
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


2012-10-07  Jack Howarth  <>

	PR libstdc++/54847
	* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Declare tp as struct for non-POSIX timers.
	* configure: Regenerated.

Patch hide | download patch | download mbox

Index: acinclude.m4
--- acinclude.m4	(revision 192186)
+++ acinclude.m4	(working copy)
 	[#if _POSIX_TIMERS > 0
 	  timespec tp;
+	 #else
+	  struct timespec tp;
 	  nanosleep(&tp, 0);
 	], [ac_has_nanosleep=yes], [ac_has_nanosleep=no])