]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
if compile with vs2015, enable the "static inline" declare.
authorHaffon <20966113@qq.com>
Thu, 7 Sep 2017 02:28:26 +0000 (10:28 +0800)
committerHaffon <20966113@qq.com>
Thu, 7 Sep 2017 02:28:26 +0000 (10:28 +0800)
linkhash.c
linkhash.h

index 73925b950026b9ccd9bb1c4b46a49c4762ea0c2d..f68ff6f36257aaf313bacccea474119922c1018d 100644 (file)
@@ -560,10 +560,12 @@ int lh_table_resize(struct lh_table *t, int new_size)
        return 0;
 }
 
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
 unsigned long lh_get_hash(const struct lh_table *t, const void *k)
 {
        return t->hash_fn(k);
 }
+#endif
 
 void lh_table_free(struct lh_table *t)
 {
index b2b7f7ea36df0fa7993aba1efc22ef7b561ee3ac..9080a72f66f888a4692ba036891699a1223f584a 100644 (file)
@@ -332,7 +332,14 @@ int lh_table_resize(struct lh_table *t, int new_size);
  * @param k a pointer to the key to lookup
  * @return the key's hash
  */
+#if !defined(_MSC_VER) || (_MSC_VER > 1800)
+static inline unsigned long lh_get_hash(const struct lh_table *t, const void *k)\r
+{\r
+       return t->hash_fn(k);\r
+}
+#else
 unsigned long lh_get_hash(const struct lh_table *t, const void *k);
+#endif
 
 /* Don't use this outside of linkhash.h: */
 #ifdef __UNCONST