Skip to content

Commit

Permalink
Portability: Use AC_C_INLINE to check for availability of the inline …
Browse files Browse the repository at this point in the history
…keyword
  • Loading branch information
jrosdahl committed Feb 27, 2010
1 parent 8ce0a84 commit 6256d04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions configure.ac
Expand Up @@ -114,6 +114,8 @@ else
mkdir -p zlib
fi

AC_C_INLINE

AC_CONFIG_FILES([Makefile dev.mk])
AC_OUTPUT

Expand Down
2 changes: 2 additions & 0 deletions hashtable.h
Expand Up @@ -32,6 +32,8 @@
#ifndef __HASHTABLE_CWC22_H__
#define __HASHTABLE_CWC22_H__

#include "config.h"

struct hashtable;

/* Example of use:
Expand Down
5 changes: 4 additions & 1 deletion hashtable_private.h
Expand Up @@ -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
Expand Down

0 comments on commit 6256d04

Please sign in to comment.