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 <[email protected]> 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 > > >
