From patchwork Thu Jan 25 18:12:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shashank Ram X-Patchwork-Id: 866001 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zS9CK6Rwbz9ryr for ; Fri, 26 Jan 2018 05:13:49 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 3EF88F77; Thu, 25 Jan 2018 18:13:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 72E1CF6D for ; Thu, 25 Jan 2018 18:13:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from EX13-EDG-OU-002.vmware.com (ex13-edg-ou-002.vmware.com [208.91.0.190]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E98BD134 for ; Thu, 25 Jan 2018 18:13:45 +0000 (UTC) Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Thu, 25 Jan 2018 10:13:40 -0800 Received: from localhost.localdomain (desktop-gtu4ktv.prom.eng.vmware.com [10.33.78.79]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 6C9AB40864; Thu, 25 Jan 2018 10:13:45 -0800 (PST) From: Shashank Ram To: Date: Thu, 25 Jan 2018 10:12:08 -0800 Message-ID: <20180125181208.16676-1-rams@vmware.com> X-Mailer: git-send-email 2.9.3.windows.2 MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-002.vmware.com: rams@vmware.com does not designate permitted sender hosts) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] openvswitch/types.h: Drop the member name in initializer macro X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 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 --- include/openvswitch/types.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.9.3.windows.2 diff --git a/include/openvswitch/types.h b/include/openvswitch/types.h index b8b4fa9..45e7079 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 }