]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Portability: Use AC_C_INLINE to check for availability of the inline keyword
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 27 Feb 2010 23:07:52 +0000 (00:07 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 27 Feb 2010 23:07:52 +0000 (00:07 +0100)
configure.ac
hashtable.h
hashtable_private.h

index 078673c2bc90b5d91aaa5fe11e6abc7a42cfa6e0..f87a12a41f0e69f39fa431ddeb579c364ac0cc56 100644 (file)
@@ -114,6 +114,8 @@ else
     mkdir -p zlib
 fi
 
+AC_C_INLINE
+
 AC_CONFIG_FILES([Makefile dev.mk])
 AC_OUTPUT
 
index 3120af6055bba399fbe49f9f8b92cd0a4b0523a0..428000752f7e22612e60f785b9afcac5e2b4d3f7 100644 (file)
@@ -32,6 +32,8 @@
 #ifndef __HASHTABLE_CWC22_H__
 #define __HASHTABLE_CWC22_H__
 
+#include "config.h"
+
 struct hashtable;
 
 /* Example of use:
index a4909cde531c4dbc621813cd9e5e273397634635..a81afca8843485fedaf72c40b39f9133bae9ea30 100644 (file)
@@ -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