X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=m4%2Fdup.m4;h=bec5880a34dfa16283ec1800a0edcf39b861c90c;hb=0874a5828bbb4784e9c9d54243b3c978e8e54ece;hp=8f2ec8f7b09151a464858000499b702743b7f4bc;hpb=4810e2dc1d9b1bf84da97d7869f7ad8743b3b3c4;p=gnulib.git diff --git a/m4/dup.m4 b/m4/dup.m4 index 8f2ec8f7b..bec5880a3 100644 --- a/m4/dup.m4 +++ b/m4/dup.m4 @@ -1,5 +1,5 @@ -# dup.m4 serial 1 -dnl Copyright (C) 2011 Free Software Foundation, Inc. +# dup.m4 serial 2 +dnl Copyright (C) 2011-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. @@ -7,35 +7,10 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_DUP], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_CHECK_HEADERS_ONCE([unistd.h]) - AC_CACHE_CHECK([whether dup supports bad arguments], [gl_cv_func_dup_works], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM([[ -#if HAVE_UNISTD_H -# include -#else -# include -#endif -#include -]], - [[if (dup (-1) != -1) - return 1; - if (errno != EBADF) - return 2; - return 0; - ]])], - [gl_cv_func_dup_works=yes], - [gl_cv_func_dup_works=no], - [case "$host_os" in - mingw*) gl_cv_func_dup_works="guessing no" ;; - *) gl_cv_func_dup_works="guessing yes" ;; - esac - ]) - ]) - case "$gl_cv_func_dup_works" in - *no) REPLACE_DUP=1 ;; - esac + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_DUP=1 + fi dnl Replace dup() for supporting the gnulib-defined fchdir() function, dnl to keep fchdir's bookkeeping up-to-date. m4_ifdef([gl_FUNC_FCHDIR], [