From 66bab9c9dad103bd5ff3d25484ea6920df62de94 Mon Sep 17 00:00:00 2001 From: Shashank Ram Date: Thu, 25 Jan 2018 10:12:08 -0800 Subject: [PATCH] openvswitch/types.h: Drop the member name in initializer macro MSVC++ compiler does not allow initializing a struct while explicitly initializing a member in the struct. Not allowed: static const struct eth_addr a = {{ .ea= { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}; Alowed: static const struct eth_addr b = {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}; *An extra curly brace is required for GCC in case the struct contains a union. Signed-off-by: Shashank Ram Tested-by: Yi-Hung Wei Signed-off-by: Ben Pfaff --- include/openvswitch/types.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/openvswitch/types.h b/include/openvswitch/types.h index b8b4fa9ca..45e70790e 100644 --- a/include/openvswitch/types.h +++ b/include/openvswitch/types.h @@ -171,7 +171,7 @@ struct eth_addr { /* Ethernet address constant, e.g. ETH_ADDR_C(01,23,45,67,89,ab) is * 01:23:45:67:89:ab. */ #define ETH_ADDR_C(A,B,C,D,E,F) \ - { { .ea = { 0x##A, 0x##B, 0x##C, 0x##D, 0x##E, 0x##F } } } + { { { 0x##A, 0x##B, 0x##C, 0x##D, 0x##E, 0x##F } } } /* Similar to struct eth_addr, for EUI-64 addresses. */ struct eth_addr64 { @@ -184,8 +184,7 @@ struct eth_addr64 { /* EUI-64 address constant, e.g. ETH_ADDR_C(01,23,45,67,89,ab,cd,ef) is * 01:23:45:67:89:ab:cd:ef. */ #define ETH_ADDR64_C(A,B,C,D,E,F,G,H) \ - { { .ea64 = { 0x##A, 0x##B, 0x##C, 0x##D, \ - 0x##E, 0x##F, 0x##G, 0x##H} } } + { { { 0x##A, 0x##B, 0x##C, 0x##D, 0x##E, 0x##F, 0x##G, 0x##H } } } #ifdef __cplusplus } -- 2.39.5