Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define SIZE_OF_LONG_INT to replace sizeof(long) in #if #1636

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ else
fi
fi

# Get the size of long int
AC_CACHE_CHECK([Size of long int],
[iperf3_cv_sizeof_long],
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[#include <stdio.h>]],
[[fprintf(stderr, "%zd", sizeof(long)); return(0)]])],
[iperf3_cv_sizeof_long=`./conftest$EXEEXT 2>&1`],
[AC_MSG_ERROR(Failed to compile and run size of long test)]))
AC_DEFINE_UNQUOTED([SIZE_OF_LONG_INT], $iperf3_cv_sizeof_long, [Size of long int.])

# Check for TCP_CONGESTION sockopt (believed to be Linux and FreeBSD only)
AC_CACHE_CHECK([TCP_CONGESTION socket option],
[iperf3_cv_header_tcp_congestion],
Expand Down
4 changes: 2 additions & 2 deletions src/cjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@
# include <inttypes.h>
#else
# ifndef PRIu64
# if sizeof(long) == 8
# if SIZE_OF_LONG_INT == 8
# define PRIu64 "lu"
# else
# define PRIu64 "llu"
# endif
# ifndef PRId64
# if sizeof(long) == 8
# if SIZE_OF_LONG_INT == 8
# define PRId64 "ld"
# else
# define PRId64 "lld"
Expand Down
2 changes: 1 addition & 1 deletion src/iperf.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# include <inttypes.h>
#else
# ifndef PRIu64
# if sizeof(long) == 8
# if SIZE_OF_LONG_INT == 8
# define PRIu64 "lu"
# else
# define PRIu64 "llu"
Expand Down
2 changes: 1 addition & 1 deletion src/iperf_locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
# include <inttypes.h>
#else
# ifndef PRId64
# if sizeof(long) == 8
# if SIZE_OF_LONG_INT == 8
# define PRId64 "ld"
# else
# define PRId64 "lld"
Expand Down
2 changes: 1 addition & 1 deletion src/iperf_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# include <inttypes.h>
#else
# ifndef PRIu64
# if sizeof(long) == 8
# if SIZE_OF_LONG_INT == 8
# define PRIu64 "lu"
# else
# define PRIu64 "llu"
Expand Down
Loading