Skip to content

Commit 6324c68

Browse files
committed
Merge #12678: build: Fix a few compilation issues with Clang 7 and -Werror
8ae4132 Remove redundant checks for MSG_* from configure.ac (Vasil Dimov) 71129e0 Do not check for main() in libminiupnpc (Vasil Dimov) 8c632f7 ax_boost_{chrono,unit_test_framework}.m4: take changes from upstream (Vasil Dimov) Pull request description: Tree-SHA512: a99ef98c0b94f892eadeda24b3d55c25bedf225b98c6e4178cf6c2d886b44d43e9f75414d0b37db9ac261cec2350666e5e64fab9c104249dd34ff485c51663cb
2 parents 872c921 + 8ae4132 commit 6324c68

File tree

5 files changed

+14
-29
lines changed

5 files changed

+14
-29
lines changed

build-aux/m4/ax_boost_chrono.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# http://www.gnu.org/software/autoconf-archive/ax_boost_chrono.html
2+
# https://www.gnu.org/software/autoconf-archive/ax_boost_chrono.html
33
# ===========================================================================
44
#
55
# SYNOPSIS
@@ -8,7 +8,7 @@
88
#
99
# DESCRIPTION
1010
#
11-
# Test for System library from the Boost C++ libraries. The macro requires
11+
# Test for Chrono library from the Boost C++ libraries. The macro requires
1212
# a preceding call to AX_BOOST_BASE. Further documentation is available at
1313
# <http://randspringer.de/boost/index.html>.
1414
#
@@ -29,7 +29,7 @@
2929
# and this notice are preserved. This file is offered as-is, without any
3030
# warranty.
3131

32-
#serial 1
32+
#serial 4
3333

3434
AC_DEFUN([AX_BOOST_CHRONO],
3535
[
@@ -68,7 +68,7 @@ AC_DEFUN([AX_BOOST_CHRONO],
6868
CXXFLAGS_SAVE=$CXXFLAGS
6969
7070
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/chrono.hpp>]],
71-
[[boost::chrono::system_clock::time_point time;]])],
71+
[[boost::chrono::system_clock::time_point* time = new boost::chrono::system_clock::time_point; delete time;]])],
7272
ax_cv_boost_chrono=yes, ax_cv_boost_chrono=no)
7373
CXXFLAGS=$CXXFLAGS_SAVE
7474
AC_LANG_POP([C++])

build-aux/m4/ax_boost_unit_test_framework.m4

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ================================================================================
2-
# http://www.gnu.org/software/autoconf-archive/ax_boost_unit_test_framework.html
3-
# ================================================================================
1+
# =================================================================================
2+
# https://www.gnu.org/software/autoconf-archive/ax_boost_unit_test_framework.html
3+
# =================================================================================
44
#
55
# SYNOPSIS
66
#
@@ -29,7 +29,7 @@
2929
# and this notice are preserved. This file is offered as-is, without any
3030
# warranty.
3131

32-
#serial 19
32+
#serial 21
3333

3434
AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK],
3535
[
@@ -66,7 +66,7 @@ AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK],
6666
[AC_LANG_PUSH([C++])
6767
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/test/unit_test.hpp>]],
6868
[[using boost::unit_test::test_suite;
69-
test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); return 0;]])],
69+
test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); if (test == NULL) { return 1; } else { return 0; }]])],
7070
ax_cv_boost_unit_test_framework=yes, ax_cv_boost_unit_test_framework=no)
7171
AC_LANG_POP([C++])
7272
])

configure.ac

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -643,22 +643,6 @@ AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,,
643643

644644
AC_CHECK_DECLS([__builtin_clz, __builtin_clzl, __builtin_clzll])
645645

646-
dnl Check for MSG_NOSIGNAL
647-
AC_MSG_CHECKING(for MSG_NOSIGNAL)
648-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
649-
[[ int f = MSG_NOSIGNAL; ]])],
650-
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,[Define this symbol if you have MSG_NOSIGNAL]) ],
651-
[ AC_MSG_RESULT(no)]
652-
)
653-
654-
dnl Check for MSG_DONTWAIT
655-
AC_MSG_CHECKING(for MSG_DONTWAIT)
656-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
657-
[[ int f = MSG_DONTWAIT; ]])],
658-
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_DONTWAIT, 1,[Define this symbol if you have MSG_DONTWAIT]) ],
659-
[ AC_MSG_RESULT(no)]
660-
)
661-
662646
dnl Check for malloc_info (for memory statistics information in getmemoryinfo)
663647
AC_MSG_CHECKING(for getmemoryinfo)
664648
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
@@ -771,7 +755,7 @@ dnl Check for libminiupnpc (optional)
771755
if test x$use_upnp != xno; then
772756
AC_CHECK_HEADERS(
773757
[miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
774-
[AC_CHECK_LIB([miniupnpc], [main],[MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])],
758+
[AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])],
775759
[have_miniupnpc=no]
776760
)
777761
fi

src/net.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@
4242
// We add a random period time (0 to 1 seconds) to feeler connections to prevent synchronization.
4343
#define FEELER_SLEEP_WINDOW 1
4444

45-
#if !defined(HAVE_MSG_NOSIGNAL)
45+
// MSG_NOSIGNAL is not available on some platforms, if it doesn't exist define it as 0
46+
#if !defined(MSG_NOSIGNAL)
4647
#define MSG_NOSIGNAL 0
4748
#endif
4849

4950
// MSG_DONTWAIT is not available on some platforms, if it doesn't exist define it as 0
50-
#if !defined(HAVE_MSG_DONTWAIT)
51+
#if !defined(MSG_DONTWAIT)
5152
#define MSG_DONTWAIT 0
5253
#endif
5354

src/netbase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
2222
#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()
2323

24-
#if !defined(HAVE_MSG_NOSIGNAL)
24+
#if !defined(MSG_NOSIGNAL)
2525
#define MSG_NOSIGNAL 0
2626
#endif
2727

0 commit comments

Comments
 (0)