aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce A. Mah <bmah@es.net>2014-05-19 10:15:36 -0700
committerBruce A. Mah <bmah@es.net>2014-05-19 10:15:36 -0700
commit426221a327ce8d37d4e6065d716f01422da4d16b (patch)
treea47bd4e04a02c033339a1436ad737d72aad2839d
parentdf1a7a2194f9b9b44fc62c3f3401a94a79d48d9d (diff)
downloadiperf3-426221a327ce8d37d4e6065d716f01422da4d16b.tar.gz
Check HAVE_STDINT_H before trying to include <stdint.h>.
Partial fix for compilation on some Solaris versions. Fixes #175. Submitted by: @marksolaris
-rw-r--r--examples/mic.c2
-rw-r--r--examples/mis.c2
-rw-r--r--src/iperf.h2
-rw-r--r--src/iperf_api.c2
-rw-r--r--src/iperf_server_api.c2
-rw-r--r--src/iperf_udp.c2
-rw-r--r--src/main.c4
-rw-r--r--src/t_units.c2
-rw-r--r--src/units.c2
9 files changed, 20 insertions, 0 deletions
diff --git a/examples/mic.c b/examples/mic.c
index 7d1d9d5..73dc143 100644
--- a/examples/mic.c
+++ b/examples/mic.c
@@ -3,7 +3,9 @@
#include <unistd.h>
#include <string.h>
#include <sysexits.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <iperf_api.h>
diff --git a/examples/mis.c b/examples/mis.c
index 9e72197..3ec12a1 100644
--- a/examples/mis.c
+++ b/examples/mis.c
@@ -3,7 +3,9 @@
#include <unistd.h>
#include <string.h>
#include <sysexits.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <iperf_api.h>
diff --git a/src/iperf.h b/src/iperf.h
index df8d479..f394ba1 100644
--- a/src/iperf.h
+++ b/src/iperf.h
@@ -14,7 +14,9 @@
#include <sys/time.h>
#include <sys/types.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <sys/socket.h>
#include <netinet/tcp.h>
diff --git a/src/iperf_api.c b/src/iperf_api.c
index 01db183..1f13f09 100644
--- a/src/iperf_api.c
+++ b/src/iperf_api.c
@@ -27,7 +27,9 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <pthread.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <netinet/tcp.h>
#include <sys/time.h>
#include <sys/resource.h>
diff --git a/src/iperf_server_api.c b/src/iperf_server_api.c
index d375de2..7f3d20b 100644
--- a/src/iperf_server_api.c
+++ b/src/iperf_server_api.c
@@ -24,7 +24,9 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <pthread.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <netinet/tcp.h>
#include <sys/time.h>
#include <sys/resource.h>
diff --git a/src/iperf_udp.c b/src/iperf_udp.c
index 00f02ed..bc7a8f1 100644
--- a/src/iperf_udp.c
+++ b/src/iperf_udp.c
@@ -16,7 +16,9 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <sys/time.h>
#include <sys/select.h>
diff --git a/src/main.c b/src/main.c
index d01994e..d4ebf2c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -15,13 +15,17 @@
#include <errno.h>
#include <signal.h>
#include <unistd.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <netinet/tcp.h>
#include "iperf.h"
diff --git a/src/t_units.c b/src/t_units.c
index 4117514..5a8ee68 100644
--- a/src/t_units.c
+++ b/src/t_units.c
@@ -8,7 +8,9 @@
*/
#include <assert.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <stdio.h>
#include <string.h>
diff --git a/src/units.c b/src/units.c
index 917422b..770adad 100644
--- a/src/units.c
+++ b/src/units.c
@@ -54,7 +54,9 @@
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/tcp.h>