From patchwork Wed Jan 10 17:27:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alin-Gabriel Serdean X-Patchwork-Id: 858442 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 3zGwvb3SNhz9s75 for ; Thu, 11 Jan 2018 04:28:11 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C1454E7F; Wed, 10 Jan 2018 17:28:08 +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 41EA9E76 for ; Wed, 10 Jan 2018 17:28:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B0F0D444 for ; Wed, 10 Jan 2018 17:28:06 +0000 (UTC) X-Originating-IP: 89.46.161.178 Received: from localhost.localdomain (unknown [89.46.161.178]) (Authenticated sender: aserdean@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 12908A80CD; Wed, 10 Jan 2018 18:28:04 +0100 (CET) From: Alin Gabriel Serdean To: dev@openvswitch.org Date: Wed, 10 Jan 2018 19:27:52 +0200 Message-Id: <20180110172752.10652-1-aserdean@ovn.org> X-Mailer: git-send-email 2.10.2.windows.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Alin Gabriel Serdean Subject: [ovs-dev] [PATCH] windows: Fix x64 build 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org MSVC complains: error C4013: 'atomic_storeX' undefined; assuming extern returning int atomic_storeX - is no longer defined. This patch adds back its implementation. Signed-off-by: Alin Gabriel Serdean Acked-by: Ben Pfaff --- lib/ovs-atomic-msvc.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ovs-atomic-msvc.h b/lib/ovs-atomic-msvc.h index 6727d2c..9def887 100644 --- a/lib/ovs-atomic-msvc.h +++ b/lib/ovs-atomic-msvc.h @@ -124,8 +124,13 @@ atomic_signal_fence(memory_order order) } #elif _M_X64 /* 64 bit writes are atomic on amd64 if 64 bit aligned. */ -#define atomic_store64(DST, SRC, ORDER) \ - atomic_storeX(64, DST, SRC, ORDER) +#define atomic_store64(DST, SRC, ORDER) \ + if (ORDER == memory_order_seq_cst) { \ + InterlockedExchange64((int64_t volatile *) (DST), \ + (int64_t) (SRC)); \ + } else { \ + *(DST) = (SRC); \ + } #endif #define atomic_store8(DST, SRC, ORDER) \