mirror of
https://github.com/boostorg/dll.git
synced 2026-07-21 13:13:30 +00:00
Drop C++03 support (#66)
This commit is contained in:
@@ -20,7 +20,7 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- toolset: gcc-12
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
cxxstd: "11,14,17,2a"
|
||||
os: ubuntu-22.04
|
||||
# UBSAN complains on vtables and fails. No ',undefined -fno-sanitize-recover=undefined' flags!
|
||||
cxxflags: "cxxflags=--coverage -fsanitize=address,leak -DBOOST_TRAVISCI_BUILD"
|
||||
@@ -39,10 +39,10 @@ jobs:
|
||||
ignore_coverage: "*/detail/pe_info.hpp */detail/macho_info.hpp */filesystem/src/*"
|
||||
- toolset: clang
|
||||
compiler: clang++-10
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
cxxstd: "11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
#- toolset: clang
|
||||
# cxxstd: "03,11,14,17,2a"
|
||||
# cxxstd: "11,14,17,2a"
|
||||
# os: macos-10.15
|
||||
# cxxflags: "cxxflags=--coverage -DBOOST_TRAVISCI_BUILD"
|
||||
# linkflags: "linkflags=--coverage"
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
addrmd: 32,64
|
||||
os: windows-2019
|
||||
- toolset: gcc
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
cxxstd: "11,14,17,2a"
|
||||
addrmd: 64
|
||||
os: windows-2019
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ target_link_libraries(boost_dll
|
||||
Boost::predef
|
||||
Boost::smart_ptr
|
||||
Boost::spirit
|
||||
Boost::static_assert
|
||||
Boost::system
|
||||
Boost::throw_exception
|
||||
Boost::type_index
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#define BOOST_DLL_ALIAS_HPP
|
||||
|
||||
#include <boost/dll/config.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/predef/compiler.h>
|
||||
#include <boost/predef/os.h>
|
||||
#include <boost/dll/detail/aggressive_ptr_cast.hpp>
|
||||
@@ -45,7 +44,7 @@ namespace boost { namespace dll {
|
||||
#define BOOST_DLL_SELECTANY __declspec(selectany)
|
||||
|
||||
#define BOOST_DLL_SECTION(SectionName, Permissions) \
|
||||
BOOST_STATIC_ASSERT_MSG( \
|
||||
static_assert( \
|
||||
sizeof(#SectionName) < 10, \
|
||||
"Some platforms require section names to be at most 8 bytes" \
|
||||
); \
|
||||
@@ -84,7 +83,7 @@ namespace boost { namespace dll {
|
||||
* \param Permissions Can be "read" or "write" (without quotes!).
|
||||
*/
|
||||
#define BOOST_DLL_SECTION(SectionName, Permissions) \
|
||||
BOOST_STATIC_ASSERT_MSG( \
|
||||
static_assert( \
|
||||
sizeof(#SectionName) < 10, \
|
||||
"Some platforms require section names to be at most 8 bytes" \
|
||||
); \
|
||||
@@ -93,7 +92,7 @@ namespace boost { namespace dll {
|
||||
#else // #if !BOOST_OS_MACOS && !BOOST_OS_IOS
|
||||
|
||||
#define BOOST_DLL_SECTION(SectionName, Permissions) \
|
||||
BOOST_STATIC_ASSERT_MSG( \
|
||||
static_assert( \
|
||||
sizeof(#SectionName) < 10, \
|
||||
"Some platforms require section names to be at most 8 bytes" \
|
||||
); \
|
||||
|
||||
@@ -15,24 +15,6 @@
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
|
||||
defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || \
|
||||
defined(BOOST_NO_CXX11_CONSTEXPR) || \
|
||||
defined(BOOST_NO_CXX11_NULLPTR) || \
|
||||
defined(BOOST_NO_CXX11_NOEXCEPT) || \
|
||||
defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || \
|
||||
defined(BOOST_NO_CXX11_FINAL) || \
|
||||
defined(BOOST_NO_CXX11_ALIGNOF) || \
|
||||
defined(BOOST_NO_CXX11_STATIC_ASSERT) || \
|
||||
defined(BOOST_NO_CXX11_SMART_PTR) || \
|
||||
defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) || \
|
||||
defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE("C++03 support is deprecated in Boost.DLL 1.82 and will be removed in Boost.DLL 1.84.")
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_DLL_DOXYGEN
|
||||
/// Define this macro to make Boost.DLL use C++17's std::filesystem::path, std::system_error and std::error_code.
|
||||
#define BOOST_DLL_USE_STD_FS BOOST_DLL_USE_STD_FS
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include <boost/core/addressof.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#include <boost/type_traits/is_member_pointer.hpp>
|
||||
#include <boost/type_traits/is_void.hpp>
|
||||
@@ -36,18 +35,18 @@ template <class To, class From>
|
||||
BOOST_FORCEINLINE typename boost::disable_if_c<boost::is_member_pointer<To>::value || boost::is_reference<To>::value || boost::is_member_pointer<From>::value, To>::type
|
||||
aggressive_ptr_cast(From v) BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
boost::is_pointer<To>::value && boost::is_pointer<From>::value,
|
||||
"`agressive_ptr_cast` function must be used only for pointer casting."
|
||||
);
|
||||
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
boost::is_void< typename boost::remove_pointer<To>::type >::value
|
||||
|| boost::is_void< typename boost::remove_pointer<From>::type >::value,
|
||||
"`agressive_ptr_cast` function must be used only for casting to or from void pointers."
|
||||
);
|
||||
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
sizeof(v) == sizeof(To),
|
||||
"Pointer to function and pointer to object differ in size on your platform."
|
||||
);
|
||||
@@ -64,17 +63,17 @@ template <class To, class From>
|
||||
BOOST_FORCEINLINE typename boost::disable_if_c<!boost::is_reference<To>::value || boost::is_member_pointer<From>::value, To>::type
|
||||
aggressive_ptr_cast(From v) BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
boost::is_pointer<From>::value,
|
||||
"`agressive_ptr_cast` function must be used only for pointer casting."
|
||||
);
|
||||
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
boost::is_void< typename boost::remove_pointer<From>::type >::value,
|
||||
"`agressive_ptr_cast` function must be used only for casting to or from void pointers."
|
||||
);
|
||||
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
sizeof(v) == sizeof(typename boost::remove_reference<To>::type*),
|
||||
"Pointer to function and pointer to object differ in size on your platform."
|
||||
);
|
||||
@@ -93,12 +92,12 @@ template <class To, class From>
|
||||
BOOST_FORCEINLINE typename boost::disable_if_c<!boost::is_member_pointer<To>::value || boost::is_member_pointer<From>::value, To>::type
|
||||
aggressive_ptr_cast(From v) BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
boost::is_pointer<From>::value,
|
||||
"`agressive_ptr_cast` function must be used only for pointer casting."
|
||||
);
|
||||
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
boost::is_void< typename boost::remove_pointer<From>::type >::value,
|
||||
"`agressive_ptr_cast` function must be used only for casting to or from void pointers."
|
||||
);
|
||||
@@ -112,17 +111,17 @@ template <class To, class From>
|
||||
BOOST_FORCEINLINE typename boost::disable_if_c<boost::is_member_pointer<To>::value || !boost::is_member_pointer<From>::value, To>::type
|
||||
aggressive_ptr_cast(From /* v */) BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
boost::is_pointer<To>::value,
|
||||
"`agressive_ptr_cast` function must be used only for pointer casting."
|
||||
);
|
||||
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
boost::is_void< typename boost::remove_pointer<To>::type >::value,
|
||||
"`agressive_ptr_cast` function must be used only for casting to or from void pointers."
|
||||
);
|
||||
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
static_assert(
|
||||
!sizeof(From),
|
||||
"Casting from member pointers to void pointer is not implemnted in `agressive_ptr_cast`."
|
||||
);
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace detail {
|
||||
*/
|
||||
template <class T>
|
||||
inline boost::dll::fs::path symbol_location_ptr(T ptr_to_symbol, boost::dll::fs::error_code& ec) {
|
||||
BOOST_STATIC_ASSERT_MSG(boost::is_pointer<T>::value, "boost::dll::symbol_location_ptr works only with pointers! `ptr_to_symbol` must be a pointer");
|
||||
static_assert(boost::is_pointer<T>::value, "boost::dll::symbol_location_ptr works only with pointers! `ptr_to_symbol` must be a pointer");
|
||||
boost::dll::fs::path ret;
|
||||
if (!ptr_to_symbol) {
|
||||
ec = boost::dll::fs::make_error_code(
|
||||
|
||||
+1
-1
@@ -12,5 +12,5 @@
|
||||
"category": [
|
||||
"System"
|
||||
],
|
||||
"cxxstd": "03"
|
||||
"cxxstd": "11"
|
||||
}
|
||||
|
||||
+4
-1
@@ -11,6 +11,8 @@
|
||||
import testing ;
|
||||
import path ;
|
||||
|
||||
import ../../config/checks/config : requires ;
|
||||
|
||||
local RDYNAMIC = <target-os>freebsd:<linkflags>"-rdynamic" <target-os>solaris:<linkflags>"-Bdynamic" <target-os>aix:<linkflags>"-rdynamic"
|
||||
<target-os>qnxnto,<toolset>qcc:<linkflags>"-Bdynamic" <target-os>qnxnto,<toolset>gcc:<linkflags>"-rdynamic"
|
||||
<target-os>android:<linkflags>"-rdynamic" <target-os>linux:<linkflags>"-rdynamic" <target-os>darwin,<toolset>gcc:<linkflags>"-dynamic"
|
||||
@@ -25,7 +27,8 @@ lib static_refcounting_plugin : ../example/tutorial8/refcounting_plugin.cpp : <l
|
||||
project
|
||||
: source-location .
|
||||
: requirements
|
||||
|
||||
[ requires cxx11_rvalue_references ]
|
||||
[ requires cxx11_static_assert ]
|
||||
# linux
|
||||
<target-os>linux:<linkflags>"-ldl"
|
||||
<toolset>gcc:<cxxflags>"-Wall -Wextra -pedantic -Wno-long-long"
|
||||
|
||||
+4
-4
@@ -61,19 +61,19 @@ environment:
|
||||
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
# ADDPATH: C:\cygwin\bin;
|
||||
# TOOLSET: gcc
|
||||
# CXXSTD: 03,11,14,1z
|
||||
# CXXSTD: 11,14,1z
|
||||
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
# ADDPATH: C:\cygwin64\bin;
|
||||
# TOOLSET: gcc
|
||||
# CXXSTD: 03,11,14,1z
|
||||
# CXXSTD: 11,14,1z
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\mingw\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
CXXSTD: 11,14,1z
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
CXXSTD: 11,14,1z
|
||||
|
||||
before_build:
|
||||
- set BOOST_BRANCH=develop
|
||||
|
||||
+17
-18
@@ -10,7 +10,6 @@
|
||||
#include <boost/dll/detail/elf_info.hpp>
|
||||
#include <boost/dll/detail/pe_info.hpp>
|
||||
#include <boost/dll/detail/macho_info.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/predef/os.h>
|
||||
|
||||
@@ -41,7 +40,7 @@ inline std::size_t get_offset(const T1& v1, const T2& v2) {
|
||||
}
|
||||
|
||||
#define CHECK_FIELD(Field) \
|
||||
BOOST_STATIC_ASSERT(sizeof(v1.Field) == sizeof(v2.Field)); \
|
||||
static_assert(sizeof(v1.Field) == sizeof(v2.Field), ""); \
|
||||
BOOST_TEST(get_offset(v1, v1.Field) == get_offset(v2, v2.Field)) \
|
||||
/**/
|
||||
|
||||
@@ -49,7 +48,7 @@ inline std::size_t get_offset(const T1& v1, const T2& v2) {
|
||||
// ELF structures
|
||||
template <class T1, class T2>
|
||||
void elf_header_checks(const T1& v1, const T2& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(T1) == sizeof(T2));
|
||||
static_assert(sizeof(T1) == sizeof(T2), "");
|
||||
|
||||
CHECK_FIELD(e_ident);
|
||||
CHECK_FIELD(e_type);
|
||||
@@ -69,7 +68,7 @@ void elf_header_checks(const T1& v1, const T2& v2) {
|
||||
|
||||
template <class T1, class T2>
|
||||
void elf_sheader_checks(const T1& v1, const T2& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(T1) == sizeof(T2));
|
||||
static_assert(sizeof(T1) == sizeof(T2), "");
|
||||
|
||||
CHECK_FIELD(sh_name);
|
||||
CHECK_FIELD(sh_type);
|
||||
@@ -85,7 +84,7 @@ void elf_sheader_checks(const T1& v1, const T2& v2) {
|
||||
|
||||
template <class T1, class T2>
|
||||
void elf_sym_header_checks(const T1& v1, const T2& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(T1) == sizeof(T2));
|
||||
static_assert(sizeof(T1) == sizeof(T2), "");
|
||||
|
||||
CHECK_FIELD(st_name);
|
||||
CHECK_FIELD(st_value);
|
||||
@@ -99,7 +98,7 @@ void elf_sym_header_checks(const T1& v1, const T2& v2) {
|
||||
// PE structures
|
||||
template <class T>
|
||||
void generic_header_check(const T& v1, const dd::IMAGE_DOS_HEADER_& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(e_magic);
|
||||
CHECK_FIELD(e_cblp);
|
||||
@@ -124,7 +123,7 @@ void generic_header_check(const T& v1, const dd::IMAGE_DOS_HEADER_& v2) {
|
||||
|
||||
template <class T>
|
||||
void generic_header_check(const T& v1, const dd::IMAGE_FILE_HEADER_& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(Machine);
|
||||
CHECK_FIELD(NumberOfSections);
|
||||
@@ -137,7 +136,7 @@ void generic_header_check(const T& v1, const dd::IMAGE_FILE_HEADER_& v2) {
|
||||
|
||||
template <class T>
|
||||
void generic_header_check(const T& v1, const dd::IMAGE_DATA_DIRECTORY_& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(VirtualAddress);
|
||||
CHECK_FIELD(Size);
|
||||
@@ -145,7 +144,7 @@ void generic_header_check(const T& v1, const dd::IMAGE_DATA_DIRECTORY_& v2) {
|
||||
|
||||
template <class T>
|
||||
void generic_header_check(const T& v1, const dd::IMAGE_EXPORT_DIRECTORY_& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(Characteristics);
|
||||
CHECK_FIELD(TimeDateStamp);
|
||||
@@ -163,7 +162,7 @@ void generic_header_check(const T& v1, const dd::IMAGE_EXPORT_DIRECTORY_& v2) {
|
||||
|
||||
template <class T>
|
||||
void generic_header_check(const T& v1, const dd::IMAGE_SECTION_HEADER_& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(Name);
|
||||
CHECK_FIELD(VirtualAddress);
|
||||
@@ -178,7 +177,7 @@ void generic_header_check(const T& v1, const dd::IMAGE_SECTION_HEADER_& v2) {
|
||||
|
||||
template <class T, class AddrT>
|
||||
void generic_header_check(const T& v1, const dd::IMAGE_OPTIONAL_HEADER_template<AddrT>& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(Magic);
|
||||
CHECK_FIELD(MajorLinkerVersion);
|
||||
@@ -213,7 +212,7 @@ void generic_header_check(const T& v1, const dd::IMAGE_OPTIONAL_HEADER_template<
|
||||
|
||||
template <class T, class AddrT>
|
||||
void generic_header_check(const T& v1, const dd::IMAGE_NT_HEADERS_template<AddrT>& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(Signature);
|
||||
CHECK_FIELD(FileHeader);
|
||||
@@ -221,7 +220,7 @@ void generic_header_check(const T& v1, const dd::IMAGE_NT_HEADERS_template<AddrT
|
||||
}
|
||||
template <class T, class AddrT>
|
||||
void generic_header_check(const T& v1, const dd::mach_header_template<AddrT>& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(magic);
|
||||
CHECK_FIELD(cputype);
|
||||
@@ -234,7 +233,7 @@ void generic_header_check(const T& v1, const dd::mach_header_template<AddrT>& v2
|
||||
|
||||
template <class T, class AddrT>
|
||||
void generic_header_check(const T& v1, const dd::segment_command_template<AddrT>& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(cmd);
|
||||
CHECK_FIELD(cmdsize);
|
||||
@@ -251,7 +250,7 @@ void generic_header_check(const T& v1, const dd::segment_command_template<AddrT>
|
||||
|
||||
template <class T, class AddrT>
|
||||
void generic_header_check(const T& v1, const dd::section_template<AddrT>& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(sectname);
|
||||
CHECK_FIELD(segname);
|
||||
@@ -267,7 +266,7 @@ void generic_header_check(const T& v1, const dd::section_template<AddrT>& v2) {
|
||||
|
||||
template <class T>
|
||||
void generic_header_check(const T& v1, const dd::symtab_command_& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(cmd);
|
||||
CHECK_FIELD(cmdsize);
|
||||
@@ -279,7 +278,7 @@ void generic_header_check(const T& v1, const dd::symtab_command_& v2) {
|
||||
|
||||
template <class T, class AddrT>
|
||||
void generic_header_check(const T& v1, const dd::nlist_template<AddrT>& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
//CHECK_FIELD(n_strx);
|
||||
CHECK_FIELD(n_type);
|
||||
@@ -290,7 +289,7 @@ void generic_header_check(const T& v1, const dd::nlist_template<AddrT>& v2) {
|
||||
|
||||
template <class T>
|
||||
void generic_header_check(const T& v1, const dd::load_command_& v2) {
|
||||
BOOST_STATIC_ASSERT(sizeof(v1) == sizeof(v2));
|
||||
static_assert(sizeof(v1) == sizeof(v2), "");
|
||||
|
||||
CHECK_FIELD(cmd);
|
||||
CHECK_FIELD(cmdsize);
|
||||
|
||||
Reference in New Issue
Block a user