0001-Detect-bool-definition-considering-stdbool.h-being-p.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From 6df092a4153c6c37cfaddcabf2cd25a910a7f6e1 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Mon, 2 Sep 2019 15:40:52 -0700
  4. Subject: [PATCH] Detect bool definition considering stdbool.h being present
  5. This helps in defining the value correctly on different platforms e.g.
  6. clang/libc++ depends on the definition coming from stdbool.h
  7. current builds fail to compile therefore
  8. TMPDIR/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/iperf2/2.0.13-r0/recipe-sysroot/usr/include/c++/v1/type_traits:742:29: error: redefinition of '__libcpp_is_integral<int>'
  9. template <> struct __libcpp_is_integral<int> : public true_type {};
  10. ^~~~~~~~~~~~~~~~~~~~~~~~~
  11. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  12. ---
  13. m4/dast.m4 | 7 ++++++-
  14. 1 file changed, 6 insertions(+), 1 deletion(-)
  15. --- a/m4/dast.m4
  16. +++ b/m4/dast.m4
  17. @@ -11,7 +11,12 @@ AH_TEMPLATE([false])
  18. AC_DEFUN(DAST_CHECK_BOOL, [
  19. -AC_CHECK_SIZEOF(bool)
  20. +if test "$ac_cv_header_stdbool_h" = yes; then
  21. + AC_CHECK_SIZEOF(bool,,[#include <stdbool.h>])
  22. +else
  23. + AC_CHECK_SIZEOF(bool)
  24. +fi
  25. +
  26. if test "$ac_cv_sizeof_bool" = 0 ; then
  27. AC_DEFINE(bool, int)
  28. fi
  29. --- a/configure.ac
  30. +++ b/configure.ac
  31. @@ -113,7 +113,7 @@ AC_SEARCH_LIBS([socket], [socket], [],
  32. dnl Checks for header files.
  33. AC_HEADER_STDC
  34. -AC_CHECK_HEADERS([arpa/inet.h libintl.h net/ethernet.h net/if.h linux/ip.h linux/udp.h linux/if_packet.h linux/filter.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h signal.h ifaddrs.h])
  35. +AC_CHECK_HEADERS([arpa/inet.h libintl.h net/ethernet.h net/if.h linux/ip.h linux/udp.h linux/if_packet.h linux/filter.h netdb.h netinet/in.h stdbool.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h signal.h ifaddrs.h])
  36. dnl ===================================================================
  37. dnl Checks for typedefs, structures
  38. --- a/include/util.h
  39. +++ b/include/util.h
  40. @@ -56,7 +56,9 @@
  41. #ifdef HAVE_CONFIG_H
  42. #include "config.h"
  43. #endif
  44. -
  45. +#ifdef HAVE_STDBOOL_H
  46. +# include <stdbool.h>
  47. +#endif
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif