Make attribute packed equivalent for MSC compilers.
[cascardo/ovs.git] / lib / compiler.h
index f3cbe96..4b1834f 100644 (file)
 #define OVS_PACKED_ENUM
 #endif
 
+#ifndef _MSC_VER
+#define OVS_PACKED(DECL) DECL __attribute__((__packed__))
+#else
+#define OVS_PACKED(DECL) __pragma(pack(push, 1)) DECL __pragma(pack(pop))
+#endif
+
 #endif /* compiler.h */