diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-08-31 14:39:23 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-08-31 14:39:23 -0700 |
commit | 5ff25beec7ad7fb229b943ecb86fe55bcad531c4 (patch) | |
tree | 0c9dc7ea5723347abf7836b66695804a0f3ac546 /sf-pcap.c | |
parent | 1a44e70c2d2b754b3f92c66a0a590f6fdc347566 (diff) | |
download | libpcap-5ff25beec7ad7fb229b943ecb86fe55bcad531c4.tar.gz |
The official #define for 32-bit and 64-bit Windows is _WIN32.
It's _WIN32, with a leading underscore, not WIN32. See, for example:
https://sourceforge.net/p/predef/wiki/OperatingSystems/
and
https://msdn.microsoft.com/en-us/library/b0084kay.aspx
*Some* environments may also define WIN32, but we shouldn't depend on
that.
Diffstat (limited to 'sf-pcap.c')
-rw-r--r-- | sf-pcap.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -37,9 +37,9 @@ static const char rcsid[] _U_ = #include "config.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #include <pcap-stdinc.h> -#else /* WIN32 */ +#else /* _WIN32 */ #if HAVE_INTTYPES_H #include <inttypes.h> #elif HAVE_STDINT_H @@ -49,7 +49,7 @@ static const char rcsid[] _U_ = #include <sys/bitypes.h> #endif #include <sys/types.h> -#endif /* WIN32 */ +#endif /* _WIN32 */ #include <errno.h> #include <memory.h> @@ -70,7 +70,7 @@ static const char rcsid[] _U_ = /* * Setting O_BINARY on DOS/Windows is a bit tricky */ -#if defined(WIN32) +#if defined(_WIN32) #define SET_BINMODE(f) _setmode(_fileno(f), _O_BINARY) #elif defined(MSDOS) #if defined(__HIGHC__) @@ -635,7 +635,7 @@ static pcap_dumper_t * pcap_setup_dump(pcap_t *p, int linktype, FILE *f, const char *fname) { -#if defined(WIN32) || defined(MSDOS) +#if defined(_WIN32) || defined(MSDOS) /* * If we're writing to the standard output, put it in binary * mode, as savefiles are binary files. @@ -690,7 +690,7 @@ pcap_dump_open(pcap_t *p, const char *fname) f = stdout; fname = "standard output"; } else { -#if !defined(WIN32) && !defined(MSDOS) +#if !defined(_WIN32) && !defined(MSDOS) f = fopen(fname, "w"); #else f = fopen(fname, "wb"); @@ -742,7 +742,7 @@ pcap_dump_open_append(pcap_t *p, const char *fname) if (fname[0] == '-' && fname[1] == '\0') return (pcap_setup_dump(p, linktype, stdout, "standard output")); -#if !defined(WIN32) && !defined(MSDOS) +#if !defined(_WIN32) && !defined(MSDOS) f = fopen(fname, "r+"); #else f = fopen(fname, "rb+"); @@ -771,7 +771,7 @@ pcap_dump_open_append(pcap_t *p, const char *fname) } } -#if defined(WIN32) || defined(MSDOS) +#if defined(_WIN32) || defined(MSDOS) /* * We turn off buffering. * XXX - why? And why not on the standard output? |