Browse Source

if compile with vs2015, enable the "static inline" declare.

tags/json-c-0.13-20171207
Haffon 8 years ago
parent
commit
e9f9f14f22
2 changed files with 9 additions and 0 deletions
  1. +2
    -0
      linkhash.c
  2. +7
    -0
      linkhash.h

+ 2
- 0
linkhash.c View 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)
{


+ 7
- 0
linkhash.h View 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)
{
return t->hash_fn(k);
}
#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


Loading…
Cancel
Save