Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbd57c3a

Browse files
author
Bryan Henderson
committed
Quiet compiler warnings about missing prototypes in Linux's bitops.h.
1 parent435d4f4 commitbd57c3a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

‎src/backend/port/linux/asm/bitops.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp