summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-09-23 21:38:44 +0200
committerBruno Haible <bruno@clisp.org>2011-09-23 21:38:44 +0200
commit9b604b4cbfad7422bacc1c723df1d027b6a7c738 (patch)
tree8299ebfd0839d14f62eb4c89e650d9623eeba157 /tests
parentfeb7da5e51db75738e91cce135c1906f7dc10948 (diff)
downloadgnulib-9b604b4cbfad7422bacc1c723df1d027b6a7c738.tar.gz
New module 'msvc-nothrow'. Makes _get_osfhandle safe on MSVC 9.
* lib/msvc-nothrow.h: New file. * lib/msvc-nothrow.c: New file. * m4/msvc-nothrow.m4: New file. * modules/msvc-nothrow: New file. * lib/dup2.c: Include msvc-nothrow.h. (rpl_dup2): No need to protect _get_osfhandle call here. * lib/accept4.c: Include msvc-nothrow.h. * lib/error.c: Likewise. * lib/fcntl.c: Likewise. * lib/lseek.c: Likewise. * lib/nonblocking.c: Likewise. * lib/poll.c: Likewise. * lib/read.c: Likewise. * lib/select.c: Likewise. * lib/sockets.h: Likewise. * lib/sockets.c: Likewise. * lib/stdio-read.c: Likewise. * lib/stdio-write.c: Likewise. * lib/write.c: Likewise. * lib/w32sock.h: Likewise. * lib/w32spawn.h: Likewise. * lib/flock.c: Include msvc-nothrow.h instead of <io.h>. * lib/fsync.c: Likewise. * lib/isapipe.c: Likewise. * modules/dup2 (Depends-on): Add msvc-nothrow. * modules/accept4 (Depends-on): Likewise. * modules/error (Depends-on): Likewise. * modules/fcntl (Depends-on): Likewise. * modules/lseek (Depends-on): Likewise. * modules/nonblocking (Depends-on): Likewise. * modules/poll (Depends-on): Likewise. * modules/read (Depends-on): Likewise. * modules/select (Depends-on): Likewise. * modules/sockets (Depends-on): Likewise. * modules/sigpipe (Depends-on): Likewise. * modules/write (Depends-on): Likewise. * modules/accept (Depends-on): Likewise. * modules/bind (Depends-on): Likewise. * modules/connect (Depends-on): Likewise. * modules/gethostname (Depends-on): Likewise. * modules/getpeername (Depends-on): Likewise. * modules/getsockname (Depends-on): Likewise. * modules/getsockopt (Depends-on): Likewise. * modules/ioctl (Depends-on): Likewise. * modules/listen (Depends-on): Likewise. * modules/recv (Depends-on): Likewise. * modules/recvfrom (Depends-on): Likewise. * modules/send (Depends-on): Likewise. * modules/sendto (Depends-on): Likewise. * modules/setsockopt (Depends-on): Likewise. * modules/shutdown (Depends-on): Likewise. * modules/socket (Depends-on): Likewise. * modules/execute (Depends-on): Likewise. * modules/spawn-pipe (Depends-on): Likewise. * modules/flock (Depends-on): Likewise. * modules/fsync (Depends-on): Likewise. * modules/isapipe (Depends-on): Likewise. * tests/test-cloexec.c: Include msvc-nothrow.h. * tests/test-dup-safer.c: Likewise. * tests/test-dup2.c: Likewise. * tests/test-dup3.c: Likewise. * tests/test-fcntl.c: Likewise. * tests/test-pipe.c: Likewise. * tests/test-pipe2.c: Likewise. * modules/cloexec-tests (Depends-on): Add msvc-nothrow. * modules/unistd-safer-tests (Depends-on): Likewise. * modules/dup2-tests (Depends-on): Likewise. * modules/dup3-tests (Depends-on): Likewise. * modules/fcntl-tests (Depends-on): Likewise. * modules/pipe-posix-tests (Depends-on): Likewise. * modules/pipe2-tests (Depends-on): Likewise.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-cloexec.c2
-rw-r--r--tests/test-dup-safer.c2
-rw-r--r--tests/test-dup2.c2
-rw-r--r--tests/test-dup3.c2
-rw-r--r--tests/test-fcntl.c2
-rw-r--r--tests/test-pipe.c2
-rw-r--r--tests/test-pipe2.c2
7 files changed, 14 insertions, 0 deletions
diff --git a/tests/test-cloexec.c b/tests/test-cloexec.c
index 374de30386..c1473d515d 100644
--- a/tests/test-cloexec.c
+++ b/tests/test-cloexec.c
@@ -28,6 +28,8 @@
/* Get declarations of the Win32 API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
#endif
#include "binary-io.h"
diff --git a/tests/test-dup-safer.c b/tests/test-dup-safer.c
index 14cfafffea..5cb45f5fd4 100644
--- a/tests/test-dup-safer.c
+++ b/tests/test-dup-safer.c
@@ -32,6 +32,8 @@
/* Get declarations of the Win32 API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
#endif
#if !O_BINARY
diff --git a/tests/test-dup2.c b/tests/test-dup2.c
index 37454e965c..a14807a36e 100644
--- a/tests/test-dup2.c
+++ b/tests/test-dup2.c
@@ -36,6 +36,8 @@ SIGNATURE_CHECK (dup2, int, (int, int));
/* Get declarations of the Win32 API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
#endif
#include "macros.h"
diff --git a/tests/test-dup3.c b/tests/test-dup3.c
index ed3a88f41b..033193df62 100644
--- a/tests/test-dup3.c
+++ b/tests/test-dup3.c
@@ -32,6 +32,8 @@ SIGNATURE_CHECK (dup3, int, (int, int, int));
/* Get declarations of the Win32 API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
#endif
#include "binary-io.h"
diff --git a/tests/test-fcntl.c b/tests/test-fcntl.c
index 59b0077190..c6066ead19 100644
--- a/tests/test-fcntl.c
+++ b/tests/test-fcntl.c
@@ -34,6 +34,8 @@ SIGNATURE_CHECK (fcntl, int, (int, int, ...));
/* Get declarations of the Win32 API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
#endif
#include "binary-io.h"
diff --git a/tests/test-pipe.c b/tests/test-pipe.c
index 5302c3ecec..90f41f9107 100644
--- a/tests/test-pipe.c
+++ b/tests/test-pipe.c
@@ -29,6 +29,8 @@ SIGNATURE_CHECK (pipe, int, (int[2]));
/* Get declarations of the Win32 API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
#endif
#include "binary-io.h"
diff --git a/tests/test-pipe2.c b/tests/test-pipe2.c
index d83162c2f5..c278f7aaff 100644
--- a/tests/test-pipe2.c
+++ b/tests/test-pipe2.c
@@ -29,6 +29,8 @@ SIGNATURE_CHECK (pipe2, int, (int[2], int));
/* Get declarations of the Win32 API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+/* Get _get_osfhandle. */
+# include "msvc-nothrow.h"
#endif
#include "binary-io.h"