#ifndef tcpdump_stdinc_h
#define tcpdump_stdinc_h
-#ifdef WIN32
+#include <errno.h>
+
+#ifdef _WIN32
#include <stdint.h>
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include <io.h>
-#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <net/netdb.h> /* in wpcap's Win32/include */
#define vsnprintf _vsnprintf
#define RETSIGTYPE void
-#else /* WIN32 */
+#else /* _WIN32 */
#include <ctype.h>
#include <unistd.h>
#include <arpa/inet.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
#ifndef HAVE___ATTRIBUTE__
#define __attribute__(x)
* Note: this also requires that padding be put into the structure,
* at least for compilers where it's implemented as __attribute__((packed)).
*/
-#if defined(__GNUC__)
+#if !(defined(_MSC_VER) && defined(UNALIGNED))
+/* MSVC may have its own macro defined with the same name and purpose. */
#undef UNALIGNED
#define UNALIGNED __attribute__((packed))
-#else
- /* MSVC may have its own macro defined with the same name and purpose. */
#endif
-#if defined(WIN32) || defined(MSDOS)
+#if defined(_WIN32) || defined(MSDOS)
#define FOPEN_READ_TXT "rt"
#define FOPEN_READ_BIN "rb"
#define FOPEN_WRITE_TXT "wt"