diff options
author | Bryan Henderson <bryanh@giraffe.netgate.net> | 1996-11-18 01:45:44 +0000 |
---|---|---|
committer | Bryan Henderson <bryanh@giraffe.netgate.net> | 1996-11-18 01:45:44 +0000 |
commit | bd57c3afe5e3133bae7e6d39d11e41ad6d701347 (patch) | |
tree | 40bc03eff8ef32da776f7ea1eb1c7d7995b5399d | |
parent | 435d4f4a79e2d8cb780e612796800a6207e02643 (diff) | |
download | postgresql-bd57c3afe5e3133bae7e6d39d11e41ad6d701347.tar.gz postgresql-bd57c3afe5e3133bae7e6d39d11e41ad6d701347.zip |
Quiet compiler warnings about missing prototypes in Linux's bitops.h.
-rw-r--r-- | src/backend/port/linux/asm/bitops.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/backend/port/linux/asm/bitops.h b/src/backend/port/linux/asm/bitops.h new file mode 100644 index 00000000000..c706e83ecf5 --- /dev/null +++ b/src/backend/port/linux/asm/bitops.h @@ -0,0 +1,41 @@ +/* This is a hack that lets us use the -Wmissing-prototypes compile option. + + A bug or weakness in Linux's asm/bitops.h file makes it define a bunch + of inline functions without first declaring a prototype. This causes + -Wmissing-prototypes to generate warnings. These warnings are distracting + and, in the case of -Werror, fatal. + + asm/bitops.h gets included by the Linux C library sem.h, which is included + in several Postgres backend source files. + + Until Linux is fixed, we have our own version of asm/bitops.h that gets + included first because it is in a directory mentioned in a -I option, + whereas the Linux asm/bitops.h is in a standard include directory. (This + is GNU C preprocessor function). + + Our asm/bitops.h declares prototypes and then includes the Linux + asm/bitops.h. If Linux changes these functions, our asm/bitops.h will + stop compiling and will have to be updated. + + -Bryan 1996.11.17 +*/ + +#ifndef POSTGRES_BITOPS_H +#define POSTGRES_BITOPS_H + +#ifdef __SMP__ +#define PG_BITOPS_VOLATILE volatile +#else +#define PG_BITOPS_VOLATILE +#endif + +extern __inline__ int set_bit(int nr, PG_BITOPS_VOLATILE void * addr); +extern __inline__ int clear_bit(int nr, PG_BITOPS_VOLATILE void * addr); +extern __inline__ int change_bit(int nr, PG_BITOPS_VOLATILE void * addr); +extern __inline__ int test_bit(int nr, const PG_BITOPS_VOLATILE void * addr); +extern __inline__ int find_first_zero_bit(void * addr, unsigned size); +extern __inline__ int find_next_zero_bit (void * addr, int size, int offset); +extern __inline__ unsigned long ffz(unsigned long word); + +#include_next <asm/bitops.h> +#endif |