[ovs-dev] [PATCH 2/7] MSVC 64 bit compile error
Alin Serdean
aserdean at cloudbasesolutions.com
Tue Sep 22 19:53:30 UTC 2015
MSVC does not support zero-size array unless it is the last member of
a defined structure.
The error is hit only on MSVC 64 bit because the size of
uint64_t is equal with sizeof(struct tun_table *).
This patch ifdef's out the pad member of the structure tun_metadata
in case we are on the MSVC 64 bit compiler.
Signed-off-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
---
lib/tun-metadata.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/tun-metadata.h b/lib/tun-metadata.h
index 624c881..801ed13 100644
--- a/lib/tun-metadata.h
+++ b/lib/tun-metadata.h
@@ -36,6 +36,7 @@ struct tun_table;
#define TUN_METADATA_NUM_OPTS 64
#define TUN_METADATA_TOT_OPT_SIZE 256
+
/* Tunnel option data, plus metadata to aid in their interpretation.
*
* The option data exists in two forms and is interpreted differently depending
@@ -63,7 +64,9 @@ struct tun_metadata {
uint8_t len; /* Length of data in 'opts'. */
} present;
struct tun_table *tab; /* Types & lengths for 'opts' and 'opt_map'. */
+#ifndef _WIN64
uint8_t pad[sizeof(uint64_t) - sizeof(struct tun_table *)]; /* Make 8 bytes */
+#endif
union {
uint8_t u8[TUN_METADATA_TOT_OPT_SIZE]; /* Values from tunnel TLVs. */
struct geneve_opt gnv[GENEVE_TOT_OPT_SIZE / sizeof(struct geneve_opt)];
--
1.9.5.msysgit.0
More information about the dev
mailing list