This is the mail archive of the 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]

[PATCH] Committed: RE [Bug libstdc++/33578] __gnu_parallel::yield broken on mingw32

> ------- Comment #6 from bkoz at gcc dot gnu dot org  
> 2007-10-10 02:00 -------
> Danny, if this allows compilation of then 
> please check your
> patch in, as it doesn't change semantics.
> Then we can figure out what we really want here....
This is what I have checked in after regtesting with make check-parallel
2007-10-11  Danny Smith  <>

	PR libstdc++/33578
	* include/parallel/compatibility.h.  Use POSIX sched_yield on
	(Sleep): Add prototype for __MINGW32__.

Index: include/parallel/compatibility.h
--- include/parallel/compatibility.h	(revision 129215)
+++ include/parallel/compatibility.h	(working copy)
@@ -45,7 +45,7 @@
 #include <sys/atomic.h>
-#if !defined(_WIN32)
+#if !defined(_WIN32) || defined (__CYGWIN__)
 #include <sched.h>
@@ -56,6 +56,14 @@
 #undef min
+#ifdef __MINGW32__
+// Including <windows.h> will drag in all the windows32 names.  Since
+// that can cause user code portability problems, we just declare the
+// one needed function here.
+extern "C"
+__attribute((dllimport)) void __attribute__((stdcall)) Sleep (unsigned
 namespace __gnu_parallel
 #if defined(__ICC)
@@ -327,7 +335,7 @@
   inline void
-#ifdef _WIN32
+#if defined (_WIN32) && !defined (__CYGWIN__)

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