]> The Tcpdump Group git mirrors - tcpdump/commitdiff
mind MSVC's UNALIGNED macro (GH #335 pt.2)
authorDenis Ovsienko <[email protected]>
Mon, 14 Oct 2013 12:34:21 +0000 (16:34 +0400)
committerDenis Ovsienko <[email protected]>
Mon, 14 Oct 2013 12:34:21 +0000 (16:34 +0400)
This change addresses a compile warning that Gisle Vanem troubleshooted
in MSVC build (<winnt.h> defines UNALIGNED).

tcpdump-stdinc.h

index a5634fb0159d849f0fb688c0b05c3c03311f9374..eb6c9428d9064260a68948128a3a8df3921fa656 100644 (file)
@@ -171,7 +171,11 @@ typedef char* caddr_t;
  * Note: this also requires that padding be put into the structure,
  * at least for compilers where it's implemented as __attribute__((packed)).
  */
+#if defined(_MSC_VER) && defined(UNALIGNED)
+/* MSVC may have its own macro defined with the same name and purpose. */
+#else
 #define UNALIGNED      __attribute__((packed))
+#endif
 
 #if defined(WIN32) || defined(MSDOS)
   #define FOPEN_READ_TXT   "rt"