diff options
author | Philip Prindeville <philipp@redfish-solutions.com> | 2017-11-08 17:29:26 +0000 |
---|---|---|
committer | Bruce A. Mah <bmah@kitchenlab.org> | 2017-11-08 09:29:26 -0800 |
commit | d88f4cecf34f2b54ef3e4eab148991b276870f02 (patch) | |
tree | 65046b75e36f93d897cc74c021d20bb874620683 /src/iperf_tcp.c | |
parent | e44ec101bb932a96fa6f81bc8b94666b13e4ae73 (diff) | |
download | iperf3-d88f4cecf34f2b54ef3e4eab148991b276870f02.tar.gz |
Fix 3.3 build warnings (#664)
* Fix warnings about _GNU_SOURCE being redefined.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* Fix warnings of format-specified mismatching type
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* Simplify endianness checks
Linux can be built with too many types of C run-time library and it's
not reasonable to have to enumerate all of them, especially since at
least one of them (MUSL) goes out of its way to not be easily
detectable.
Instead, leverage autoconf better for Linux/BSD to detect either
<endian.h> or <sys/endian.h> directly.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* Sys headers should not be included directly
There's usually a top-level header which then includes the sys/
descendent.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Diffstat (limited to 'src/iperf_tcp.c')
-rw-r--r-- | src/iperf_tcp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c index 91cf032..6f86d5d 100644 --- a/src/iperf_tcp.c +++ b/src/iperf_tcp.c @@ -24,8 +24,6 @@ * This code is distributed under a BSD style license, see the LICENSE * file for complete information. */ -#include "iperf_config.h" - #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -44,6 +42,12 @@ #include "net.h" #include "cjson.h" +#if defined(HAVE_INTTYPES_H) +# include <inttypes.h> +#else +# define PRIu64 "llu" +#endif + #if defined(HAVE_FLOWLABEL) #include "flowlabel.h" #endif /* HAVE_FLOWLABEL */ @@ -90,7 +94,7 @@ iperf_tcp_send(struct iperf_stream *sp) sp->result->bytes_sent_this_interval += r; if (sp->test->debug) - printf("sent %d bytes of %d, total %llu\n", r, sp->settings->blksize, sp->result->bytes_sent); + printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sent); return r; } |