Skip to content

Commit

Permalink
Drop C++03 support (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
apolukhin authored Oct 21, 2023
1 parent 10aa54e commit eaf60c8
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 64 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions include/boost/dll/alias.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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" \
); \
Expand Down Expand Up @@ -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" \
); \
Expand All @@ -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" \
); \
Expand Down
18 changes: 0 additions & 18 deletions include/boost/dll/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 11 additions & 12 deletions include/boost/dll/detail/aggressive_ptr_cast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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."
);
Expand All @@ -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."
);
Expand All @@ -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."
);
Expand All @@ -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`."
);
Expand Down
2 changes: 1 addition & 1 deletion include/boost/dll/runtime_symbol_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion meta/libraries.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"category": [
"System"
],
"cxxstd": "03"
"cxxstd": "11"
}
5 changes: 4 additions & 1 deletion test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions test/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit eaf60c8

Please sign in to comment.