couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couch commit: updated refs/heads/master to 0529539
Date Sun, 19 Jul 2015 10:04:08 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/master c466a64d9 -> 0529539e6


Support Windows compilation for couch_ejson_compare

MSVC uses __declspec(thread) rather than __thread, so created a macro for it.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/0529539e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/0529539e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/0529539e

Branch: refs/heads/master
Commit: 0529539e65c0efa5c0dcabe925fe4e624e939eeb
Parents: c466a64
Author: NickNorth <North.N@gmail.com>
Authored: Sun Jul 19 09:56:23 2015 +0100
Committer: NickNorth <North.N@gmail.com>
Committed: Sun Jul 19 09:56:23 2015 +0100

----------------------------------------------------------------------
 priv/couch_ejson_compare/couch_ejson_compare.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0529539e/priv/couch_ejson_compare/couch_ejson_compare.c
----------------------------------------------------------------------
diff --git a/priv/couch_ejson_compare/couch_ejson_compare.c b/priv/couch_ejson_compare/couch_ejson_compare.c
index df001a1..6d1043f 100644
--- a/priv/couch_ejson_compare/couch_ejson_compare.c
+++ b/priv/couch_ejson_compare/couch_ejson_compare.c
@@ -31,6 +31,12 @@
      !enif_is_tuple(env, t))
 #endif
 
+#ifdef _MSC_VER
+#define threadlocal __declspec(thread)
+#else
+#define threadlocal __thread
+#endif
+
 static ERL_NIF_TERM ATOM_TRUE;
 static ERL_NIF_TERM ATOM_FALSE;
 static ERL_NIF_TERM ATOM_NULL;
@@ -41,7 +47,7 @@ typedef struct {
     UCollator* coll;
 } ctx_t;
 
-static __thread UCollator* collator = NULL;
+static threadlocal UCollator* collator = NULL;
 static UCollator** collators = NULL;
 static int numCollators = 0;
 static int numSchedulers = 0;


Mime
View raw message