From patchwork Thu Mar 19 17:03:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Kumar, Rohit via dev" X-Patchwork-Id: 1258341 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=openvswitch.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48jtvB25jlz9sPJ for ; Fri, 20 Mar 2020 04:19:49 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 17328230F6; Thu, 19 Mar 2020 17:19:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oxeNy8883xDe; Thu, 19 Mar 2020 17:19:46 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 9ED6B203AD; Thu, 19 Mar 2020 17:19:46 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4A415C18DA; Thu, 19 Mar 2020 17:19:46 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id C457EC07FF for ; Thu, 19 Mar 2020 17:19:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B6A7286E6E for ; Thu, 19 Mar 2020 17:19:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qP+PEDPLGDpm for ; Thu, 19 Mar 2020 17:19:43 +0000 (UTC) X-Greylist: delayed 00:15:05 by SQLgrey-1.7.6 Received: from EX13-EDG-OU-002.vmware.com (ex13-edg-ou-002.vmware.com [208.91.0.190]) by whitealder.osuosl.org (Postfix) with ESMTPS id 806F187A2F for ; Thu, 19 Mar 2020 17:19:43 +0000 (UTC) Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Thu, 19 Mar 2020 10:04:33 -0700 Received: from host-192-168-0-10.openstack.local (unknown [10.39.2.216]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 26423B23CA; Thu, 19 Mar 2020 13:04:37 -0400 (EDT) To: Date: Thu, 19 Mar 2020 10:03:15 -0700 Message-ID: <1584637395-25000-1-git-send-email-harchana@vmware.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-002.vmware.com: harchana@vmware.com does not designate permitted sender hosts) Subject: [ovs-dev] [PATCH] util: Update OVS_TYPEOF macro for Windows. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Archana Holla via dev From: "Kumar, Rohit via dev" Reply-To: Archana Holla Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" OVS_TYPEOF macro doesn’t return the type of object for non __GNUC__ platforms. Updating it for _WIN32 platforms when used from C++ code. Signed-off-by: Archana Holla --- include/openvswitch/util.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/openvswitch/util.h b/include/openvswitch/util.h index 9189e64..af7d1b0 100644 --- a/include/openvswitch/util.h +++ b/include/openvswitch/util.h @@ -86,8 +86,12 @@ OVS_NO_RETURN void ovs_assert_failure(const char *, const char *, const char *); #ifdef __GNUC__ #define OVS_TYPEOF(OBJECT) typeof(OBJECT) #else +#if defined (__cplusplus) && defined(_WIN32) +#define OVS_TYPEOF(OBJECT) decltype(OBJECT) +#else #define OVS_TYPEOF(OBJECT) void * #endif +#endif /* Given OBJECT of type pointer-to-structure, expands to the offset of MEMBER * within an instance of the structure.