You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.3 KiB

  1. From 60db5d0b0fd8be9afede7e8a14e708f5429f2023 Mon Sep 17 00:00:00 2001
  2. From: Florian Fainelli <f.fainelli@gmail.com>
  3. Date: Sun, 7 May 2017 11:16:06 -0700
  4. Subject: [PATCH] udp: Avoid including netdb.h
  5. netdb.h pulls in a large chain of include files:
  6. rpc/netdb.h
  7. rpc/types.h
  8. rpc/types.h re-defines TRUE/FALSE and does it in this way:
  9. #ifndef FALSE
  10. # define FALSE (0)
  11. #endif
  12. #ifndef TRUE
  13. # define TRUE (1)
  14. #endif
  15. And this later causes build problems that appear in this way:
  16. mipsel-linux-gnu-gcc -Wall -DVER=1.8 -D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME
  17. -DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC -Os -pipe -mno-branch-likely
  18. -mips32r2 -mtune=24kc -fno-caller-saves -Wno-unused-result
  19. -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro
  20. -I/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/include
  21. -I/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/include
  22. -I/home/florian/dev/toolchains/stbgcc-4.8-1.5/usr/include
  23. -I/home/florian/dev/toolchains/stbgcc-4.8-1.5/include
  24. -DHAVE_CLOCK_ADJTIME -DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC -c -o
  25. udp.o udp.c
  26. In file included from
  27. /home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/include/rpc/netdb.h:45:0,
  28. from
  29. /home/florian/dev/toolchains/stbgcc-4.8-1.5/mipsel-linux-gnu/sys-root/usr/include/netdb.h:32,
  30. from udp.c:23:
  31. pdt.h:25:7: error: expected identifier before '(' token
  32. enum {FALSE, TRUE};
  33. ^
  34. <builtin>: recipe for target 'udp.o' failed
  35. Upon inspection, it does not appear that netdb.h is providing any useful
  36. definition or declaration, so let's just remove its inclusion.
  37. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
  38. ---
  39. udp.c | 1 -
  40. udp6.c | 1 -
  41. 2 files changed, 2 deletions(-)
  42. diff --git a/udp.c b/udp.c
  43. index 6dabc31836fe..530a2ee3748d 100644
  44. --- a/udp.c
  45. +++ b/udp.c
  46. @@ -20,7 +20,6 @@
  47. #include <errno.h>
  48. #include <fcntl.h>
  49. #include <net/if.h>
  50. -#include <netdb.h>
  51. #include <netinet/in.h>
  52. #include <stdio.h>
  53. #include <stdlib.h>
  54. diff --git a/udp6.c b/udp6.c
  55. index c229cac0c41c..89e27bf9e863 100644
  56. --- a/udp6.c
  57. +++ b/udp6.c
  58. @@ -20,7 +20,6 @@
  59. #include <errno.h>
  60. #include <fcntl.h>
  61. #include <net/if.h>
  62. -#include <netdb.h>
  63. #include <netinet/in.h>
  64. #include <stdio.h>
  65. #include <stdlib.h>
  66. --
  67. 2.11.0