fmod, fmodl: Fix computation for large quotients x / y.
[gnulib.git] / m4 / unlink.m4
index 1c559af..4adf762 100644 (file)
@@ -1,14 +1,14 @@
-# unlink.m4 serial 6
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# unlink.m4 serial 9
+dnl Copyright (C) 2009-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_UNLINK],
 [
-  AC_REQUIRE([gl_AC_DOS])
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CHECK_HEADERS_ONCE([unistd.h])
   dnl Detect FreeBSD 7.2, AIX 7.1, Solaris 9 bug.
   AC_CACHE_CHECK([whether unlink honors trailing slashes],
     [gl_cv_func_unlink_honors_slashes],
@@ -19,7 +19,11 @@ AC_DEFUN([gl_FUNC_UNLINK],
      fi
      AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
-         [[#include <unistd.h>
+         [[#if HAVE_UNISTD_H
+           # include <unistd.h>
+           #else /* on Windows with MSVC */
+           # include <io.h>
+           #endif
            #include <errno.h>
          ]],
          [[int result = 0;
@@ -71,7 +75,12 @@ AC_DEFUN([gl_FUNC_UNLINK],
            AC_RUN_IFELSE(
              [AC_LANG_SOURCE([[
                 #include <stdlib.h>
-                #include <unistd.h>
+                #if HAVE_UNISTD_H
+                # include <unistd.h>
+                #else /* on Windows with MSVC */
+                # include <direct.h>
+                # include <io.h>
+                #endif
                 int main ()
                 {
                   int result = 0;
@@ -109,6 +118,5 @@ AC_DEFUN([gl_FUNC_UNLINK],
           esac
         }; then
     REPLACE_UNLINK=1
-    AC_LIBOBJ([unlink])
   fi
 ])