summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-oe/recipes-benchmark/iperf2/iperf2/0001-Detect-bool-definition-considering-stdbool.h-being-p.patch
blob: 45c69ca067fd201b284b42b680c37f5f0111d941 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 6df092a4153c6c37cfaddcabf2cd25a910a7f6e1 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 2 Sep 2019 15:40:52 -0700
Subject: [PATCH] Detect bool definition considering stdbool.h being present

This helps in defining the value correctly on different platforms e.g.
clang/libc++ depends on the definition coming from stdbool.h
current builds fail to compile therefore

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>'
template <>          struct __libcpp_is_integral<int>                : public true_type {};
                            ^~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 m4/dast.m4 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/m4/dast.m4
+++ b/m4/dast.m4
@@ -11,7 +11,12 @@ AH_TEMPLATE([false])
 
 AC_DEFUN(DAST_CHECK_BOOL, [
 
-AC_CHECK_SIZEOF(bool)
+if test "$ac_cv_header_stdbool_h" = yes; then
+  AC_CHECK_SIZEOF(bool,,[#include <stdbool.h>])
+else
+  AC_CHECK_SIZEOF(bool)
+fi
+
 if test "$ac_cv_sizeof_bool" = 0 ; then
   AC_DEFINE(bool, int)
 fi
--- a/configure.ac
+++ b/configure.ac
@@ -113,7 +113,7 @@ AC_SEARCH_LIBS([socket], [socket], [],
 
 dnl Checks for header files.
 AC_HEADER_STDC
-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])
+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])
 
 dnl ===================================================================
 dnl Checks for typedefs, structures
--- a/include/util.h
+++ b/include/util.h
@@ -56,7 +56,9 @@
 #ifdef HAVE_CONFIG_H
     #include "config.h"
 #endif
-
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+#endif
 #ifdef __cplusplus
 extern "C" {
 #endif