[m-rev.] diff: avoid sleep function on MinGW64

Julien Fischer jfischer at opturion.com
Mon Mar 25 15:51:22 AEDT 2013


Avoid using sleep() in trace library on MinGW64.

The standard autoconf tests report that the sleep function is available on
MinGW64.  It isn't and we currently get a warning about an implicitly declared
function in the trace directory.   What is happening here is that the function
is not officially supported, and hence not in the library headers, but a symbol
corresponding to is exported from somewhere in the standard library.  (This is
what had happened last time something similar occurred on MinGW.)

The fix is to tell configure that sleep is not available on *mingw* and use
Sleep instead.

configure.ac:
     Don't attempt to use the function sleep on MinGW.a

Julien.

diff --git a/configure.ac b/configure.ac
index a7f7bc3..64d91e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1209,6 +1209,15 @@ case "$host" in
         ;;
 esac

+# Do not try to use sleep() on MinGW or MinGW64 as it isn't available
+# *despite* what the standard autoconf tests report.
+#
+case "$host" in
+    *mingw*)
+        ac_cv_func_sleep=no
+        ;;
+esac
+
 mercury_check_for_functions \
         sysconf getpagesize gethostname \
         mprotect memalign posix_memalign memmove \



More information about the reviews mailing list