summaryrefslogtreecommitdiff
path: root/m4/close.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-09-24 02:48:19 +0200
committerBruno Haible <bruno@clisp.org>2011-09-24 02:48:19 +0200
commit895d4925b7eb3475050328ef820e8ddfee95e1de (patch)
tree5afb6f546a11f4edc7b032fe47a95c260424e71d /m4/close.m4
parent5dc4536ed01689b540e7abebf628b69bc1027077 (diff)
downloadgnulib-895d4925b7eb3475050328ef820e8ddfee95e1de.tar.gz
close: Support for MSVC 9.
* lib/close.c: Include <errno.h>, msvc-inval.h. (close_nothrow): New function. (rpl_close): Use it. * m4/close.m4 (gl_FUNC_CLOSE): Replace close if the platform has an invalid parameter handler. * modules/close (Depends-on): Add msvc-inval. * modules/dup2-tests (Depends-on): Add close. * modules/dup3-tests (Depends-on): Likewise. * modules/fcntl-tests (Depends-on): Likewise. * modules/spawn-pipe-tests (Depends-on): Likewise. * modules/unistd-safer-tests (Depends-on): Likewise. * doc/posix-functions/close.texi: Mention the problem on MSVC.
Diffstat (limited to 'm4/close.m4')
-rw-r--r--m4/close.m46
1 files changed, 5 insertions, 1 deletions
diff --git a/m4/close.m4 b/m4/close.m4
index cd30d08cf6..f860a320c1 100644
--- a/m4/close.m4
+++ b/m4/close.m4
@@ -1,4 +1,4 @@
-# close.m4 serial 7
+# close.m4 serial 8
dnl Copyright (C) 2008-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,6 +7,10 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_CLOSE],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_CLOSE=1
+ fi
m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
gl_PREREQ_SYS_H_WINSOCK2
if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then