testcase: __inline__ declaration without implementation aborts cparser
[cparser] / parsetest / cp_error037.c
1 // Aus CygWin's /usr/include/asm/byteorder.h zusammenkopiert
2 // Es gibt keine weitere Definition von __constant_ntohl
3
4 typedef unsigned long uint32_t;
5
6 extern __inline__ uint32_t      __ntohl(uint32_t);
7 extern __inline__ uint32_t      __constant_ntohl(uint32_t);
8
9 extern __inline__ uint32_t
10 __ntohl(uint32_t x)
11 {
12         __asm__("xchgb %b0,%h0\n\t"     /* swap lower bytes     */
13                 "rorl $16,%0\n\t"       /* swap words           */
14                 "xchgb %b0,%h0"         /* swap higher bytes    */
15                 :"=q" (x)
16                 : "0" (x));
17         return x;
18 }
19
20 #define __constant_ntohl(x) \
21         ((uint32_t)((((uint32_t)(x) & 0x000000ffU) << 24) | \
22                    (((uint32_t)(x) & 0x0000ff00U) <<  8) | \
23                    (((uint32_t)(x) & 0x00ff0000U) >>  8) | \
24                    (((uint32_t)(x) & 0xff000000U) >> 24)))
25
26 int main(void)
27 {
28         return 0;
29 }