From: Joel Rosdahl Date: Sat, 27 Feb 2010 23:07:52 +0000 (+0100) Subject: Portability: Use AC_C_INLINE to check for availability of the inline keyword X-Git-Tag: v3.0pre0~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6256d04b043f3938be8adf4e9dc7472c0cc8bcaf;p=thirdparty%2Fccache.git Portability: Use AC_C_INLINE to check for availability of the inline keyword --- diff --git a/configure.ac b/configure.ac index 078673c2b..f87a12a41 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 3120af605..428000752 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 a4909cde5..a81afca88 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