|
| 1 | +/* This is a hack that lets us use the -Wmissing-prototypes compile option. |
| 2 | +
|
| 3 | + A bug or weakness in Linux's asm/bitops.h file makes it define a bunch |
| 4 | + of inline functions without first declaring a prototype. This causes |
| 5 | + -Wmissing-prototypes to generate warnings. These warnings are distracting |
| 6 | + and, in the case of -Werror, fatal. |
| 7 | +
|
| 8 | + asm/bitops.h gets included by the Linux C library sem.h, which is included |
| 9 | + in several Postgres backend source files. |
| 10 | +
|
| 11 | + Until Linux is fixed, we have our own version of asm/bitops.h that gets |
| 12 | + included first because it is in a directory mentioned in a -I option, |
| 13 | + whereas the Linux asm/bitops.h is in a standard include directory. (This |
| 14 | + is GNU C preprocessor function). |
| 15 | +
|
| 16 | + Our asm/bitops.h declares prototypes and then includes the Linux |
| 17 | + asm/bitops.h. If Linux changes these functions, our asm/bitops.h will |
| 18 | + stop compiling and will have to be updated. |
| 19 | +
|
| 20 | + -Bryan 1996.11.17 |
| 21 | +*/ |
| 22 | + |
| 23 | +#ifndefPOSTGRES_BITOPS_H |
| 24 | +#definePOSTGRES_BITOPS_H |
| 25 | + |
| 26 | +#ifdef__SMP__ |
| 27 | +#definePG_BITOPS_VOLATILE volatile |
| 28 | +#else |
| 29 | +#definePG_BITOPS_VOLATILE |
| 30 | +#endif |
| 31 | + |
| 32 | +extern __inline__intset_bit(intnr,PG_BITOPS_VOLATILEvoid*addr); |
| 33 | +extern __inline__intclear_bit(intnr,PG_BITOPS_VOLATILEvoid*addr); |
| 34 | +extern __inline__intchange_bit(intnr,PG_BITOPS_VOLATILEvoid*addr); |
| 35 | +extern __inline__inttest_bit(intnr,constPG_BITOPS_VOLATILEvoid*addr); |
| 36 | +extern __inline__intfind_first_zero_bit(void*addr,unsignedsize); |
| 37 | +extern __inline__intfind_next_zero_bit (void*addr,intsize,intoffset); |
| 38 | +extern __inline__unsigned longffz(unsigned longword); |
| 39 | + |
| 40 | +#include_next <asm/bitops.h> |
| 41 | +#endif |