It's not "Windows vs. (Linux or OS X or Cygwin)", it's "Windows vs. UN*X".

Either it's Windows and not Cygwin (__WIN32 suffices for both 32-bit and
64-bit Windows, and this code is unlikely to work on 16-bit Windows, not
that much of anybody cares about it any more), or it's UN*X or Windows-
pretending-to-be-UN*X-with-Cygwin.  That way we don't have to pile on
new defined(XXX)'s for every UN*X out there.

Change-Id: Ia1df3378a88f2cf8bd1cc8f1a74b51adfe668370
Reviewed-on: https://code.wireshark.org/review/8016
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2015-04-11 12:53:35 -07:00
parent 9fecad775c
commit ee309553eb
1 changed files with 5 additions and 3 deletions

View File

@ -48,7 +48,7 @@
#include "wsutil/wsgetopt.h"
#endif
#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64))
#if defined(__WIN32) && !defined(__CYGWIN__)
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
@ -58,8 +58,10 @@
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#endif
#if (defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__))
#else
/*
* UN*X, or Windows pretending to be UN*X with the aid of Cygwin.
*/
#include <arpa/inet.h>
#define closesocket(socket) close(socket)