[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new module 'dup'
From: |
Bruno Haible |
Subject: |
Re: new module 'dup' |
Date: |
Sat, 24 Sep 2011 17:41:43 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
> * m4/dup.m4: New file.
Well, this configure-time test leads to a dialog box that notifies the user
about a crash in conftest.exe... Let me simplify the test:
2011-09-24 Bruno Haible <address@hidden>
dup: Simplify autoconf test.
* m4/dup.m4 (gl_FUNC_DUP): Don't run a test program. Instead, just rely
on gl_MSVC_INVAL's result.
--- m4/dup.m4.orig Sat Sep 24 17:39:28 2011
+++ m4/dup.m4 Sat Sep 24 17:34:21 2011
@@ -1,4 +1,4 @@
-# dup.m4 serial 1
+# dup.m4 serial 2
dnl Copyright (C) 2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -7,35 +7,10 @@
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 <unistd.h>
-#else
-# include <io.h>
-#endif
-#include <errno.h>
-]],
- [[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], [
--
In memoriam Sara Harpman
<http://www.genealogieonline.nl/en/stamboom-harpman/I399.php>
- new module 'dup', Bruno Haible, 2011/09/23
- Re: new module 'dup',
Bruno Haible <=