/* Test duplicating file descriptors.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* 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"
{
int use_cloexec;
-#if defined O_CLOEXEC
+#if O_CLOEXEC
for (use_cloexec = 0; use_cloexec <= 1; use_cloexec++)
#else
use_cloexec = 0;
char buffer[1];
o_flags = 0;
-#if defined O_CLOEXEC
+#if O_CLOEXEC
if (use_cloexec)
o_flags |= O_CLOEXEC;
#endif