aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/fdmisc.c
diff options
context:
space:
mode:
authorGert Doering2016-11-13 20:52:28 +0100
committerGert Doering2016-11-15 09:38:06 +0100
commit445b192a7c31187c7b5c66c8250a1886b04a2b2c (patch)
tree5e90a7012404d771324d26a79a5c02c414c39ac6 /src/openvpn/fdmisc.c
parent1ce0638627eb35631af9bfaa569468573568ec65 (diff)
downloadopenvpn-445b192a7c31187c7b5c66c8250a1886b04a2b2c.zip
openvpn-445b192a7c31187c7b5c66c8250a1886b04a2b2c.tar.gz
Replace WIN32 by _WIN32
With c99, "WIN32" is no longer automatically defined when (cross-)building for Windows, and proper compilation relies on including <windefs.h>, before checking the macro. "_WIN32" is the official define that is guaranteed to be defined by the compiler itself, no includes are needed. So, mechanically change all occurrances of "WIN32" to "_WIN32". While at it, get rid of unused WIN32_0_1 #define in syshead.h See also: http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefi ned_macros_detect_operating_system#WindowsCygwinnonPOSIXandMinGW Trac #746 v2: rebased to master, merge the console[_builtin].c changes Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Steffan Karger <steffan.karger@fox-it.com> Message-Id: <20161113195228.74090-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg13035.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/fdmisc.c')
-rw-r--r--src/openvpn/fdmisc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvpn/fdmisc.c b/src/openvpn/fdmisc.c
index 7fe449c..ce01319 100644
--- a/src/openvpn/fdmisc.c
+++ b/src/openvpn/fdmisc.c
@@ -39,7 +39,7 @@
bool
set_nonblock_action (int fd)
{
-#ifdef WIN32
+#ifdef _WIN32
u_long arg = 1;
if (ioctlsocket (fd, FIONBIO, &arg))
return false;
@@ -54,7 +54,7 @@ set_nonblock_action (int fd)
bool
set_cloexec_action (int fd)
{
-#ifndef WIN32
+#ifndef _WIN32
if (fcntl (fd, F_SETFD, FD_CLOEXEC) < 0)
return false;
#endif