udp: Avoid including netdb.h
netdb.h pulls in a large chain of include files: rpc/netdb.h rpc/types.h rpc/types.h re-defines TRUE/FALSE and does it in this way: #ifndef FALSE # define FALSE (0) #endif #ifndef TRUE # define TRUE (1) #endif And this later causes build problems that appear in this way: mipsel-linux-gnu-gcc -Wall -DVER=1.8 -D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME -DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -Wno-unused-result -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/include -I/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/include -I/home/florian/dev/toolchains/stbgcc-4.8-1.5/usr/include -I/home/florian/dev/toolchains/stbgcc-4.8-1.5/include -DHAVE_CLOCK_ADJTIME -DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC -c -o udp.o udp.c In file included from /home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/include/rpc/netdb.h:45:0, from /home/florian/dev/toolchains/stbgcc-4.8-1.5/mipsel-linux-gnu/sys-root/usr/include/netdb.h:32, from udp.c:23: pdt.h:25:7: error: expected identifier before '(' token enum {FALSE, TRUE}; ^ <builtin>: recipe for target 'udp.o' failed Upon inspection, it does not appear that netdb.h is providing any useful definition or declaration, so let's just remove its inclusion. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>master
parent
d1bb9ecbd5
commit
8b61aa2c3f
1
udp.c
1
udp.c
|
@ -20,7 +20,6 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <netdb.h>
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
Loading…
Reference in New Issue