diff --git a/configure.ac b/configure.ac index 078673c..f87a12a 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,8 @@ else mkdir -p zlib fi +AC_C_INLINE + AC_CONFIG_FILES([Makefile dev.mk]) AC_OUTPUT diff --git a/hashtable.h b/hashtable.h index 3120af6..4280007 100644 --- a/hashtable.h +++ b/hashtable.h @@ -32,6 +32,8 @@ #ifndef __HASHTABLE_CWC22_H__ #define __HASHTABLE_CWC22_H__ +#include "config.h" + struct hashtable; /* Example of use: diff --git a/hashtable_private.h b/hashtable_private.h index a4909cd..a81afca 100644 --- a/hashtable_private.h +++ b/hashtable_private.h @@ -29,7 +29,10 @@ hash(struct hashtable *h, void *k); /*****************************************************************************/ /* indexFor */ -#define indexFor(tablelength, hashvalue) ((hashvalue) % (tablelength)) +static inline unsigned int +indexFor(unsigned int tablelength, unsigned int hashvalue) { + return (hashvalue % tablelength); +} /* Only works if tablelength == 2^N */ /*static inline unsigned int