Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BF67D18D3E for ; Sun, 19 Jul 2015 09:08:46 +0000 (UTC) Received: (qmail 72224 invoked by uid 500); 19 Jul 2015 09:08:46 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 72160 invoked by uid 500); 19 Jul 2015 09:08:46 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 72148 invoked by uid 99); 19 Jul 2015 09:08:46 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Jul 2015 09:08:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id BA0F51A7215 for ; Sun, 19 Jul 2015 09:08:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 5B9liMVbYdWY for ; Sun, 19 Jul 2015 09:08:39 +0000 (UTC) Received: from mail-yk0-f170.google.com (mail-yk0-f170.google.com [209.85.160.170]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 848B743DA9 for ; Sun, 19 Jul 2015 09:08:39 +0000 (UTC) Received: by ykfw194 with SMTP id w194so39509526ykf.0 for ; Sun, 19 Jul 2015 02:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=pfmMKvau0jrLfi3DsuiaU8ku24SWqwMa/sdUkCBSkQc=; b=lFYct8Xtw37SQmCy+miqNV7NT+VBaIguXzs25Ai8rocHacaPyQAN//3KXGk/yue/4q hAUTSR33k1eBx6BDIQFVnDxoMKy4yxpLwDs3759T9AMb5SlET2gT/vt2uOpouIzlG7xk T2Brx9NfufSZsCysKghrq/6xvYZRf38Hohv4ocgUbrYuk777l2HYEyOwjlzpwhZMoReQ m8dbOxDhl/Lofyq4Wg1gcaTa1WSlM51fUC5jYZ622hkTQqzcrnhc2Yq2vSpRn6MFlVW6 O1bxb1+TN3uQd2AHonWUfPMXTPG7sX1SCP0WgRUONh1T7kXBgXgHgcpmYXPkD8zZRDjk KN6Q== X-Received: by 10.170.137.11 with SMTP id e11mr8245623ykc.50.1437296912855; Sun, 19 Jul 2015 02:08:32 -0700 (PDT) MIME-Version: 1.0 References: <1DF81DFD-135D-4913-9A63-5BD75A45DCAD@gmail.com> In-Reply-To: <1DF81DFD-135D-4913-9A63-5BD75A45DCAD@gmail.com> From: Nick North Date: Sun, 19 Jul 2015 09:08:23 +0000 Message-ID: Subject: Re: Windows build failing on couch_ejson_compare.c To: "dev@couchdb.apache.org" Content-Type: multipart/alternative; boundary=001a1139f456ed7ace051b36c331 --001a1139f456ed7ace051b36c331 Content-Type: text/plain; charset=UTF-8 Thanks for the advice. I've submitted a PR and would be grateful for a +1 from a *nix person before merging. Nick On Sun, 19 Jul 2015 at 02:46 Paul J Davis wrote: > The macro is totally fine. There are always plenty of those to account for > windows/*nix differences so it's not dirty by any means. > > > > > On Jul 18, 2015, at 8:28 AM, Nick North wrote: > > > > I see a couple of obvious solutions to this problem: > > > > > > 1. Use the thread_local keyword rather than __thread. The semantics are > > not identical, so @davisp may have views on whether the behaviour is > still > > OK. From the Windows build point of view, it would force us into > building > > with Visual Studio 2015, which releases on 20 Jul, so we don't know > whether > > it works with the rest of the build. > > 2. Create a macro that expands to __declspec(thread) or __thread as > > appropriate. This feels less correct than the thread_local solution, > but > > maybe better in the short term. > > > > Does anyone have any thoughts on which is the better way forward? Or have > > alternative suggestions? > > > > Nick > > > >> On Fri, 17 Jul 2015 at 22:09 Nick North wrote: > >> > >> Answering my own question: looks as if Microsoft uses __declspec(thread) > >> rather than __thread. > >> > >> Nick > >> > >>> On Fri, 17 Jul 2015 at 22:02 Nick North wrote: > >>> > >>> I'm trying out @wohali's Windows build, which went well up to > compilation > >>> of couch_ejson_compare.c, where it seems to be tripping up over the > changes > >>> in the recent commit > >>> < > https://github.com/apache/couchdb-couch/commit/6b38dfacbb97c5cb7c89a27115d1227c7c52dbba > > > >>> to optimise performance. Specifically it gives this series of errors: > >>> > >>> Compiling > >>> c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c > >>> ERROR: compile failed while processing c:/couchdb/src/couch: > rebar_abort > >>> Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x86 > >>> Copyright (C) Microsoft Corporation. All rights reserved. > >>> > >>> cl : Command line warning D9002 : ignoring unknown option '-fno-common' > >>> couch_ejson_compare.c > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(44) : > >>> warnin > >>> g C4431: missing type specifier - int assumed. Note: C no longer > supports > >>> defaul > >>> t-int > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(44) : > >>> error > >>> C2054: expected '(' to follow '__thread' > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(44) : > >>> error > >>> C2085: 'collator' : not in formal parameter list > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(44) : > >>> error > >>> C2143: syntax error : missing ';' before '=' > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(58) : > >>> warnin > >>> g C4255: 'get_collator' : no function prototype given: converting '()' > to > >>> '(void > >>> )' > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(62) : > >>> warnin > >>> g C4255: 'get_collator' : no function prototype given: converting '()' > to > >>> '(void > >>> )' > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(66) : > >>> error > >>> C2065: 'collator' : undeclared identifier > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(66) : > >>> warnin > >>> g C4047: '!=' : 'int' differs in levels of indirection from 'void *' > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(67) : > >>> error > >>> C2065: 'collator' : undeclared identifier > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(67) : > >>> warnin > >>> g C4047: 'return' : 'UCollator *' differs in levels of indirection from > >>> 'int' > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(70) : > >>> error > >>> C2065: 'collator' : undeclared identifier > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(70) : > >>> warnin > >>> g C4047: '=' : 'int' differs in levels of indirection from 'UCollator > *' > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(73) : > >>> error > >>> C2065: 'collator' : undeclared identifier > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(73) : > >>> warnin > >>> g C4047: 'function' : 'UCollator *' differs in levels of indirection > from > >>> 'int' > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(73) : > >>> warnin > >>> g C4024: 'ucol_close_55' : different types for formal and actual > >>> parameter 1 > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(78) : > >>> error > >>> C2065: 'collator' : undeclared identifier > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(78) : > >>> warnin > >>> g C4047: '=' : 'UCollator *' differs in levels of indirection from > 'int' > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(84) : > >>> error > >>> C2065: 'collator' : undeclared identifier > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(84) : > >>> warnin > >>> g C4047: 'return' : 'UCollator *' differs in levels of indirection from > >>> 'int' > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(256) > >>> : warni > >>> ng C4127: conditional expression is constant > >>> > c:/couchdb/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c(296) > >>> : warni > >>> ng C4127: conditional expression is constant > >>> > >>> I'll look into this further tomorrow, but someone more knowledgeable > may > >>> immediately know what the problem is and be able to suggest a solution. > >>> > >>> Nick > >>> > >>> > >>> > --001a1139f456ed7ace051b36c331--