couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couchdb-khash git commit: Support Windows build
Date Thu, 16 Jul 2015 23:14:07 GMT
Repository: couchdb-khash
Updated Branches:
  refs/heads/master 07c770e74 -> 8d160efa3


Support Windows build


Project: http://git-wip-us.apache.org/repos/asf/couchdb-khash/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-khash/commit/8d160efa
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-khash/tree/8d160efa
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-khash/diff/8d160efa

Branch: refs/heads/master
Commit: 8d160efa340384d35a73f317193f711afff13992
Parents: 07c770e
Author: Joan Touzet <wohali@apache.org>
Authored: Thu Jul 16 19:03:57 2015 -0400
Committer: Robert Newson <rnewson@apache.org>
Committed: Fri Jul 17 00:13:31 2015 +0100

----------------------------------------------------------------------
 .gitignore    |  1 +
 c_src/khash.c | 17 +++++++++++------
 rebar.config  |  3 ++-
 3 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-khash/blob/8d160efa/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index ff360df..7e47c63 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ test/*.beam
 .eunit
 .rebar
 priv/*.so
+vc*.pdb

http://git-wip-us.apache.org/repos/asf/couchdb-khash/blob/8d160efa/c_src/khash.c
----------------------------------------------------------------------
diff --git a/c_src/khash.c b/c_src/khash.c
index 6fbf463..b15a18e 100644
--- a/c_src/khash.c
+++ b/c_src/khash.c
@@ -9,6 +9,11 @@
 #include "erl_nif.h"
 #include "hash.h"
 
+#ifdef _WIN32
+#define INLINE __inline
+#else
+#define INLINE inline
+#endif
 
 #define KHASH_VERSION 0
 
@@ -53,7 +58,7 @@ typedef struct
 } khash_iter_t;
 
 
-static inline ERL_NIF_TERM
+static INLINE ERL_NIF_TERM
 make_atom(ErlNifEnv* env, const char* name)
 {
     ERL_NIF_TERM ret;
@@ -64,21 +69,21 @@ make_atom(ErlNifEnv* env, const char* name)
 }
 
 
-static inline ERL_NIF_TERM
+static INLINE ERL_NIF_TERM
 make_ok(ErlNifEnv* env, khash_priv* priv, ERL_NIF_TERM value)
 {
     return enif_make_tuple2(env, priv->atom_ok, value);
 }
 
 
-static inline ERL_NIF_TERM
+static INLINE ERL_NIF_TERM
 make_error(ErlNifEnv* env, khash_priv* priv, ERL_NIF_TERM reason)
 {
     return enif_make_tuple2(env, priv->atom_error, reason);
 }
 
 
-static inline int
+static INLINE int
 check_pid(ErlNifEnv* env, khash_t* khash)
 {
     ErlNifPid pid;
@@ -144,7 +149,7 @@ khash_hash_fun(const void* obj)
 }
 
 
-static inline khash_t*
+static INLINE khash_t*
 khash_create_int(ErlNifEnv* env, khash_priv* priv, ERL_NIF_TERM opts)
 {
     khash_t* khash = NULL;
@@ -278,7 +283,7 @@ khash_clear(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
 }
 
 
-static inline hnode_t*
+static INLINE hnode_t*
 khash_lookup_int(ErlNifEnv* env, uint32_t hv, ERL_NIF_TERM key, khash_t* khash)
 {
     khnode_t node;

http://git-wip-us.apache.org/repos/asf/couchdb-khash/blob/8d160efa/rebar.config
----------------------------------------------------------------------
diff --git a/rebar.config b/rebar.config
index 59a612b..cfbeaeb 100644
--- a/rebar.config
+++ b/rebar.config
@@ -7,6 +7,7 @@
     % {".*", "CFLAGS", "$CFLAGS -g -Wall -Werror -fPIC"}
 
     % Production compilation
-    {".*", "CFLAGS", "$CFLAGS -Wall -Werror -DNDEBUG -O3"}
+    {"(linux|solaris|darwin|freebsd)", "CFLAGS", "$CFLAGS -Wall -Werror -DNDEBUG -O3"},
+    {"win32", "CFLAGS", "$CFLAGS /O2 /DNDEBUG /Wall"}
 ]}.
 


Mime
View raw message