net/pichi: Fix build on 13.0-CURRENT

The default c++ compiler on FreeBSD 13.0 CURRENT is Clang10, which has more
strict type checking than the one on FreeBSD 12. So, adding some patch files to
fix it.

PR:	246854
Submitted by:	pichi@elude.in (maintainer)
This commit is contained in:
Fernando Apesteguía
2020-06-26 11:15:18 +00:00
parent 6c671e40c0
commit ea9a1e8d24
6 changed files with 71 additions and 6 deletions

View File

@@ -21,17 +21,17 @@ USE_RC_SUBR= pichi
PLIST_SUB= DISTVERSION=${DISTVERSION}
CMAKE_BUILD_TYPE= MinSizeRel
CMAKE_ARGS= -DVERSION=${DISTVERSION}
CMAKE_ON= BUILD_SERVER BUILD_TEST
INSTALL_TARGET= install/strip
TEST_TARGET= test
CMAKE_ARGS= -DVERSION=${DISTVERSION}
CMAKE_ON= BUILD_SERVER BUILD_TEST
INSTALL_TARGET= install/strip
TEST_TARGET= test
OPTIONS_DEFINE= DEVEL STATIC TLS
OPTIONS_DEFAULT= TLS
OPTIONS_SUB= yes
TLS_DESC= Enable TLS support ( requiring OpenSSL )
TLS_CMAKE_BOOL= ENABLE_TLS
TLS_DESC= Enable TLS support ( requiring OpenSSL )
TLS_CMAKE_BOOL= ENABLE_TLS
STATIC_DESC= Static linking
STATIC_CMAKE_BOOL= STATIC_LINK

View File

@@ -0,0 +1,18 @@
--- include/pichi/config.hpp.in.orig 1970-01-01 00:00:00 UTC
+++ include/pichi/config.hpp.in
@@ -42,6 +42,15 @@
#pragma warning(pop)
#endif // DISABLE_C4702_FOR_BEAST_FIELDS && _MSC_VER
+#ifdef __clang__
+#if !__has_feature(c_atomic)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc11-extensions"
+#include <boost/smart_ptr/detail/sp_counted_base_clang.hpp>
+#pragma clang diagnostic pop
+#endif // !__has_feature(c_atomic)
+#endif // __clang__
+
#cmakedefine CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
#ifdef CMAKE_INSTALL_PREFIX

View File

@@ -0,0 +1,15 @@
--- server/main.cpp.orig 1970-01-01 00:00:00 UTC
+++ server/main.cpp
@@ -1,10 +1,11 @@
+#include <pichi/config.hpp>
+// Include config.hpp first
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/program_options.hpp>
#include <fstream>
#include <iostream>
#include <memory>
-#include <pichi/config.hpp>
#include <stdio.h>
#ifdef HAS_UNISTD_H
#include <errno.h>

View File

@@ -0,0 +1,12 @@
--- test/endpoint.cpp.orig 1970-01-01 00:00:00 UTC
+++ test/endpoint.cpp
@@ -132,7 +132,8 @@ BOOST_AUTO_TEST_CASE(serialize_Domain)
#ifndef HAS_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
<uint8_t, 13>
#endif // HAS_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
- {0x03, 0x09, 'l', 'o', 'c', 'a', 'l', 'h', 'o', 's', 't', 0x01, 0xbb};
+ {0x03_u8, 0x09_u8, 0x6c_u8, 0x6f_u8, 0x63_u8, 0x61_u8, 0x6c_u8,
+ 0x68_u8, 0x6f_u8, 0x73_u8, 0x74_u8, 0x01_u8, 0xbb_u8};
auto fact = array<uint8_t, 13>{};
auto len = serializeEndpoint(makeEndpoint(host, port), fact);

View File

@@ -0,0 +1,9 @@
--- test/method.cpp.orig 1970-01-01 00:00:00 UTC
+++ test/method.cpp
@@ -1,5 +1,6 @@
#define BOOST_TEST_MODULE pichi method test
+#include "utils.hpp"
#include <boost/test/unit_test.hpp>
#include <pichi/common.hpp>
#include <pichi/crypto/method.hpp>

View File

@@ -0,0 +1,11 @@
--- test/utils.hpp.orig 1970-01-01 00:00:00 UTC
+++ test/utils.hpp
@@ -1,6 +1,8 @@
#ifndef PICHI_TEST_UTILS_HPP
#define PICHI_TEST_UTILS_HPP
+#include <pichi/config.hpp>
+// Include config.hpp first
#include <boost/asio/error.hpp>
#include <boost/beast/http/error.hpp>
#include <pichi/api/vos.hpp>