From e6304f480b797f42c796e2b81c34aafbf60753d5 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Thu, 19 Dec 2024 21:47:04 +0300 Subject: [PATCH] Make smart library work in C++11 mode (#80) --- include/boost/dll/import_class.hpp | 147 +++++++++---------------- include/boost/dll/smart_library.hpp | 88 +++++++-------- test/appveyor.yml | 11 +- test/cpp_ctti_type_name_parser_lib.cpp | 3 - test/cpp_import_class_test.cpp | 6 - test/cpp_import_test.cpp | 5 - test/cpp_load_test.cpp | 6 - test/cpp_mangle_test.cpp | 5 - test/cpp_mangling.cpp | 8 +- test/cpp_test_library.cpp | 5 - test/ctti_type_name_parser_test.cpp | 8 -- test/library_info_test.cpp | 4 +- test/link.hpp | 5 - test/template_method_linux_test.cpp | 6 - 14 files changed, 103 insertions(+), 204 deletions(-) diff --git a/include/boost/dll/import_class.hpp b/include/boost/dll/import_class.hpp index aac90ee1..2b9b8556 100644 --- a/include/boost/dll/import_class.hpp +++ b/include/boost/dll/import_class.hpp @@ -69,7 +69,7 @@ struct mem_fn_call_proxy - auto operator()(Args&&...args) const + auto operator()(Args&&...args) const -> decltype(mem_fn(t, std::forward(args)...)) { return mem_fn(t, std::forward(args)...); } @@ -120,11 +120,11 @@ import_class(const smart_library& lib, std::size_t size, template class imported_class { - smart_library _lib; - std::unique_ptr> _data; - bool _is_allocating; - std::size_t _size; - const std::type_info& _ti; + smart_library lib_; + std::unique_ptr> data_; + bool is_allocating_; + std::size_t size_; + const std::type_info& ti_; template inline std::unique_ptr> make_data(const smart_library& lib, Args ... args); @@ -173,7 +173,7 @@ class imported_class typedef imported_class base_t; ///Returns a pointer to the underlying class - T* get() {return _data.get();} + T* get() {return data_.get();} imported_class() = delete; imported_class(imported_class&) = delete; @@ -182,13 +182,13 @@ class imported_class imported_class& operator=(imported_class&&) = default; /// ().empty();} + bool is_move_constructible() {return !lib_.symbol_storage().template get_constructor ().empty();} ///Check if the imported class is move-assignable - bool is_move_assignable() {return !_lib.symbol_storage().template get_mem_fn ("operator=").empty();} + bool is_move_assignable() {return !lib_.symbol_storage().template get_mem_fn ("operator=").empty();} ///Check if the imported class is copy-constructible - bool is_copy_constructible() {return !_lib.symbol_storage().template get_constructor().empty();} + bool is_copy_constructible() {return !lib_.symbol_storage().template get_constructor().empty();} ///Check if the imported class is copy-assignable - bool is_copy_assignable() {return !_lib.symbol_storage().template get_mem_fn("operator=").empty();} + bool is_copy_assignable() {return !lib_.symbol_storage().template get_mem_fn("operator=").empty();} imported_class copy() const; /// move(); /// & lhs); ///Check if the class is loaded. - explicit operator bool() const {return _data;} + explicit operator bool() const {return data_;} ///Get a const reference to the std::type_info. - const std::type_info& get_type_info() {return _ti;}; + const std::type_info& get_type_info() {return ti_;}; /*! Call a member function. This returns a proxy to the function. * The proxy mechanic mechanic is necessary, so the signaute can be passed. @@ -216,7 +216,7 @@ class imported_class template const detail::mem_fn_call_proxy call(const std::string& name) { - return detail::mem_fn_call_proxy(_data.get(), name, _lib); + return detail::mem_fn_call_proxy(data_.get(), name, lib_); } /*! Call a qualified member function, i.e. const and or volatile. * @@ -229,14 +229,14 @@ class imported_class template>> const detail::mem_fn_call_proxy call(const std::string& name) { - return detail::mem_fn_call_proxy(_data.get(), name, _lib); + return detail::mem_fn_call_proxy(data_.get(), name, lib_); } ///Overload of ->* for an imported method. template const detail::mem_fn_call_proxy> operator->*(detail::mangled_library_mem_fn& mn) { - return detail::mem_fn_call_proxy>(_data.get(), mn); + return detail::mem_fn_call_proxy>(data_.get(), mn); } ///Import a method of the class. @@ -244,7 +244,7 @@ class imported_class typename boost::dll::experimental::detail::mangled_import_type>::type import(const std::string & name) { - return boost::dll::experimental::import_mangled(_lib, name); + return boost::dll::experimental::import_mangled(lib_, name); } }; @@ -313,11 +313,11 @@ inline std::unique_ptr> imported_class::make_data(const template template imported_class::imported_class(detail::sequence *, const smart_library & lib, Args...args) - : _lib(lib), - _data(make_data(lib, static_cast(args)...)), - _is_allocating(false), - _size(0), - _ti(lib.get_type_info()) + : lib_(lib), + data_(make_data(lib_, static_cast(args)...)), + is_allocating_(false), + size_(0), + ti_(lib.get_type_info()) { } @@ -325,11 +325,11 @@ imported_class::imported_class(detail::sequence *, const smart_libra template template imported_class::imported_class(detail::sequence *, const smart_library & lib, std::size_t size, Args...args) - : _lib(lib), - _data(make_data(lib, size, static_cast(args)...)), - _is_allocating(true), - _size(size), - _ti(lib.get_type_info()) + : lib_(lib), + data_(make_data(lib_, size, static_cast(args)...)), + is_allocating_(true), + size_(size), + ti_(lib.get_type_info()) { } @@ -337,11 +337,11 @@ imported_class::imported_class(detail::sequence *, const smart_libra template template imported_class::imported_class(detail::sequence *, smart_library && lib, Args...args) - : _lib(std::move(lib)), - _data(make_data(lib, static_cast(args)...)), - _is_allocating(false), - _size(0), - _ti(lib.get_type_info()) + : lib_(std::move(lib)), + data_(make_data(lib_, static_cast(args)...)), + is_allocating_(false), + size_(0), + ti_(lib.get_type_info()) { } @@ -349,11 +349,11 @@ imported_class::imported_class(detail::sequence *, smart_library && template template imported_class::imported_class(detail::sequence *, smart_library && lib, std::size_t size, Args...args) - : _lib(std::move(lib)), - _data(make_data(lib, size, static_cast(args)...)), - _is_allocating(true), - _size(size), - _ti(lib.get_type_info()) + : lib_(std::move(lib)), + data_(make_data(lib_, size, static_cast(args)...)), + is_allocating_(true), + size_(size), + ti_(lib.get_type_info()) { } @@ -361,31 +361,31 @@ imported_class::imported_class(detail::sequence *, smart_library && template inline imported_class boost::dll::experimental::imported_class::copy() const { - if (this->_is_allocating) - return imported_class::template make(_lib, *_data); + if (this->is_allocating_) + return imported_class::template make(lib_, *data_); else - return imported_class::template make(_lib, _size, *_data); + return imported_class::template make(lib_, size_, *data_); } template inline imported_class boost::dll::experimental::imported_class::move() { - if (this->_is_allocating) - return imported_class::template make(_lib, *_data); + if (this->is_allocating_) + return imported_class::template make(lib_, *data_); else - return imported_class::template make(_lib, _size, *_data); + return imported_class::template make(lib_, size_, *data_); } template inline void boost::dll::experimental::imported_class::copy_assign(const imported_class& lhs) const { - this->call("operator=")(*lhs._data); + this->call("operator=")(*lhs.data_); } template inline void boost::dll::experimental::imported_class::move_assign(imported_class& lhs) { - this->call("operator=")(static_cast(*lhs._data)); + this->call("operator=")(static_cast(*lhs.data_)); } @@ -420,89 +420,42 @@ inline void boost::dll::experimental::imported_class::move_assign(imported_cl * Overload that accepts path also throws std::bad_alloc in case of insufficient memory. */ template imported_class -import_class(const smart_library& lib_, std::size_t size, Args...args) +import_class(smart_library lib, std::size_t size, Args...args) { - smart_library lib(lib_); - return imported_class::template make(std::move(lib), size, static_cast(args)...); } //! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...) template imported_class -import_class(const smart_library& lib_, Args...args) +import_class(smart_library lib, Args...args) { - smart_library lib(lib_); return imported_class::template make(std::move(lib), static_cast(args)...); } //! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...) template imported_class -import_class(const smart_library& lib_, const std::string & alias_name, Args...args) +import_class(smart_library lib, const std::string & alias_name, Args...args) { - smart_library lib(lib_); lib.add_type_alias(alias_name); return imported_class::template make(std::move(lib), static_cast(args)...); } //! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...) template imported_class -import_class(const smart_library& lib_, std::size_t size, const std::string & alias_name, Args...args) +import_class(smart_library lib, std::size_t size, const std::string & alias_name, Args...args) { - smart_library lib(lib_); - lib.add_type_alias(alias_name); return imported_class::template make(std::move(lib), size, static_cast(args)...); } //! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...) template imported_class -import_class(const smart_library& lib_, const std::string & alias_name, std::size_t size, Args...args) +import_class(smart_library lib, const std::string & alias_name, std::size_t size, Args...args) { - smart_library lib(lib_); - lib.add_type_alias(alias_name); return imported_class::template make(std::move(lib), size, static_cast(args)...); } -//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...) -template imported_class -import_class(smart_library && lib, Args...args) -{ - return imported_class::template make(std::move(lib), static_cast(args)...); -} - -//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...) -template imported_class -import_class(smart_library && lib, const std::string & alias_name, Args...args) -{ - lib.add_type_alias(alias_name); - return imported_class::template make(std::move(lib), static_cast(args)...); -} - -//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...) -template imported_class -import_class(smart_library && lib, std::size_t size, Args...args) -{ - return imported_class::template make(std::move(lib), size, static_cast(args)...); -} - -//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...) -template imported_class -import_class(smart_library && lib, std::size_t size, const std::string & alias_name, Args...args) -{ - lib.add_type_alias(alias_name); - return imported_class::template make(std::move(lib), size, static_cast(args)...); -} - -//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...) -template imported_class -import_class(smart_library && lib, const std::string & alias_name, std::size_t size, Args...args) -{ - lib.add_type_alias(alias_name); - return imported_class::template make(std::move(lib), size, static_cast(args)...); -} - - /*! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...) * \note This function does add the type alias to the \ref boost::dll::experimental::smart_library. diff --git a/include/boost/dll/smart_library.hpp b/include/boost/dll/smart_library.hpp index d1c6ae24..0e2bce01 100644 --- a/include/boost/dll/smart_library.hpp +++ b/include/boost/dll/smart_library.hpp @@ -9,7 +9,7 @@ #define BOOST_DLL_SMART_LIBRARY_HPP_ /// \file boost/dll/smart_library.hpp -/// \warning Extremely experimental! Requires C++11! Will change in next version of Boost! boost/dll/smart_library.hpp is not included in boost/dll.hpp +/// \warning Extremely experimental! May change in next version of Boost! boost/dll/smart_library.hpp is not included in boost/dll.hpp /// \brief Contains the boost::dll::experimental::smart_library class for loading mangled symbols. #include @@ -51,10 +51,10 @@ using boost::dll::detail::destructor; * Member functions must be defined outside of the class to be exported. That is: * \code * //not exported: -* struct BOOST_SYMBOL_EXPORT my_class { void func() {}}; +* struct BOOST_SYMBOL_EXPORT my_class { void func() {} }; * //exported -* struct BOOST_SYMBOL_EXPORT my_class { void func();}; -* void my_class::func() {}; +* struct BOOST_SYMBOL_EXPORT my_class { void func(); }; +* void my_class::func() {} * \endcode * * With the current analysis, the first version does get exported in MSVC. @@ -70,14 +70,14 @@ using boost::dll::detail::destructor; * This does however not happen when the value is set inside the constructor function. */ class smart_library { - shared_library _lib; - detail::mangled_storage_impl _storage; + shared_library lib_; + detail::mangled_storage_impl storage_; public: /*! * Get the underlying shared_library */ - const shared_library &shared_lib() const {return _lib;} + const shared_library &shared_lib() const noexcept { return lib_;} using mangled_storage = detail::mangled_storage_impl; /*! @@ -85,18 +85,18 @@ class smart_library { * * \throw Nothing. */ - const mangled_storage &symbol_storage() const {return _storage;} + const mangled_storage &symbol_storage() const noexcept { return storage_; } ///Overload, for current development. - mangled_storage &symbol_storage() {return _storage;} + mangled_storage &symbol_storage() noexcept { return storage_; } //! \copydoc shared_library::shared_library() - smart_library() noexcept {}; + smart_library() = default; //! \copydoc shared_library::shared_library(const boost::dll::fs::path& lib_path, load_mode::type mode = load_mode::default_mode) smart_library(const boost::dll::fs::path& lib_path, load_mode::type mode = load_mode::default_mode) { - _lib.load(lib_path, mode); - _storage.load(lib_path); + lib_.load(lib_path, mode); + storage_.load(lib_path); } //! \copydoc shared_library::shared_library(const boost::dll::fs::path& lib_path, boost::dll::fs::error_code& ec, load_mode::type mode = load_mode::default_mode) @@ -115,9 +115,7 @@ class smart_library { * * \throw Nothing. */ - smart_library(const smart_library & lib) noexcept - : _lib(lib._lib), _storage(lib._storage) - {} + smart_library(const smart_library & lib) = default; /*! * Move a smart_library object. * @@ -125,9 +123,7 @@ class smart_library { * * \throw Nothing. */ - smart_library(smart_library&& lib) noexcept - : _lib(std::move(lib._lib)), _storage(std::move(lib._storage)) - {} + smart_library(smart_library&& lib) = default; /*! * Construct from a shared_library object. @@ -137,9 +133,9 @@ class smart_library { * \throw Nothing. */ explicit smart_library(const shared_library & lib) noexcept - : _lib(lib) + : lib_(lib) { - _storage.load(lib.location()); + storage_.load(lib.location()); } /*! * Construct from a shared_library object. @@ -149,9 +145,9 @@ class smart_library { * \throw Nothing. */ explicit smart_library(shared_library&& lib) noexcept - : _lib(std::move(lib)) + : lib_(std::move(lib)) { - _storage.load(lib.location()); + storage_.load(lib.location()); } /*! @@ -162,13 +158,13 @@ class smart_library { * * \throw Nothing. */ - ~smart_library() noexcept {}; + ~smart_library() = default; //! \copydoc shared_library::load(const boost::dll::fs::path& lib_path, load_mode::type mode = load_mode::default_mode) void load(const boost::dll::fs::path& lib_path, load_mode::type mode = load_mode::default_mode) { boost::dll::fs::error_code ec; - _storage.load(lib_path); - _lib.load(lib_path, mode, ec); + storage_.load(lib_path); + lib_.load(lib_path, mode, ec); if (ec) { boost::dll::detail::report_error(ec, "load() failed"); @@ -178,15 +174,15 @@ class smart_library { //! \copydoc shared_library::load(const boost::dll::fs::path& lib_path, boost::dll::fs::error_code& ec, load_mode::type mode = load_mode::default_mode) void load(const boost::dll::fs::path& lib_path, boost::dll::fs::error_code& ec, load_mode::type mode = load_mode::default_mode) { ec.clear(); - _storage.load(lib_path); - _lib.load(lib_path, mode, ec); + storage_.load(lib_path); + lib_.load(lib_path, mode, ec); } //! \copydoc shared_library::load(const boost::dll::fs::path& lib_path, load_mode::type mode, boost::dll::fs::error_code& ec) void load(const boost::dll::fs::path& lib_path, load_mode::type mode, boost::dll::fs::error_code& ec) { ec.clear(); - _storage.load(lib_path); - _lib.load(lib_path, mode, ec); + storage_.load(lib_path); + lib_.load(lib_path, mode, ec); } /*! @@ -204,7 +200,7 @@ class smart_library { */ template T& get_variable(const std::string &name) const { - return _lib.get(_storage.get_variable(name)); + return lib_.get(storage_.get_variable(name)); } /*! @@ -230,7 +226,7 @@ class smart_library { */ template Func& get_function(const std::string &name) const { - return _lib.get(_storage.get_function(name)); + return lib_.get(storage_.get_function(name)); } /*! @@ -259,8 +255,8 @@ class smart_library { */ template typename boost::dll::detail::get_mem_fn_type::mem_fn get_mem_fn(const std::string& name) const { - return _lib.get::mem_fn>( - _storage.get_mem_fn(name) + return lib_.get::mem_fn>( + storage_.get_mem_fn(name) ); } @@ -282,7 +278,7 @@ class smart_library { */ template constructor get_constructor() const { - return boost::dll::detail::load_ctor(_lib, _storage.get_constructor()); + return boost::dll::detail::load_ctor(lib_, storage_.get_constructor()); } /*! @@ -304,7 +300,7 @@ class smart_library { */ template destructor get_destructor() const { - return boost::dll::detail::load_dtor(_lib, _storage.get_destructor()); + return boost::dll::detail::load_dtor(lib_, storage_.get_destructor()); } /*! * Load the typeinfo of the given type. @@ -326,7 +322,7 @@ class smart_library { template const std::type_info& get_type_info() const { - return boost::dll::detail::load_type_info(_lib, _storage); + return boost::dll::detail::load_type_info(lib_, storage_); } /** * This function can be used to add a type alias. @@ -350,18 +346,18 @@ class smart_library { * \warning The alias will only be applied for the type signature, it will not replace the token in the scoped name. */ template void add_type_alias(const std::string& name) { - this->_storage.add_alias(name); + this->storage_.add_alias(name); } //! \copydoc shared_library::unload() void unload() noexcept { - _storage.clear(); - _lib.unload(); + storage_.clear(); + lib_.unload(); } //! \copydoc shared_library::is_loaded() const bool is_loaded() const noexcept { - return _lib.is_loaded(); + return lib_.is_loaded(); } //! \copydoc shared_library::operator bool() const @@ -371,25 +367,25 @@ class smart_library { //! \copydoc shared_library::has(const char* symbol_name) const bool has(const char* symbol_name) const noexcept { - return _lib.has(symbol_name); + return lib_.has(symbol_name); } //! \copydoc shared_library::has(const std::string& symbol_name) const bool has(const std::string& symbol_name) const noexcept { - return _lib.has(symbol_name); + return lib_.has(symbol_name); } //! \copydoc shared_library::assign(const shared_library& lib) smart_library& assign(const smart_library& lib) { - _lib.assign(lib._lib); - _storage.assign(lib._storage); + lib_.assign(lib.lib_); + storage_.assign(lib.storage_); return *this; } //! \copydoc shared_library::swap(shared_library& rhs) void swap(smart_library& rhs) noexcept { - _lib.swap(rhs._lib); - _storage.swap(rhs._storage); + lib_.swap(rhs.lib_); + storage_.swap(rhs.storage_); } }; diff --git a/test/appveyor.yml b/test/appveyor.yml index d8bc70f2..ef54c270 100644 --- a/test/appveyor.yml +++ b/test/appveyor.yml @@ -21,7 +21,7 @@ init: # From this point and below code is same for all the Boost libs ############################################################################################################### -version: 1.64.{build}-{branch} +version: 1.87.{build}-{branch} # branches to build branches: @@ -63,10 +63,11 @@ environment: # ADDPATH: C:\cygwin64\bin; # TOOLSET: gcc # CXXSTD: 11,14,1z - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - ADDPATH: C:\mingw\bin; - TOOLSET: gcc - CXXSTD: 11,14,1z + # MinGW 32 bit is not supported by boost system any more + #- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + # ADDPATH: C:\mingw\bin; + # TOOLSET: gcc + # 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 diff --git a/test/cpp_ctti_type_name_parser_lib.cpp b/test/cpp_ctti_type_name_parser_lib.cpp index 89947f0e..eac7f4b2 100644 --- a/test/cpp_ctti_type_name_parser_lib.cpp +++ b/test/cpp_ctti_type_name_parser_lib.cpp @@ -8,8 +8,6 @@ #include -#if (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) - #include #include @@ -138,4 +136,3 @@ cpp_plugin_type_pasrser::type_test( {} } // namespace space -#endif diff --git a/test/cpp_import_class_test.cpp b/test/cpp_import_class_test.cpp index e3bc7d58..f4af84d4 100644 --- a/test/cpp_import_class_test.cpp +++ b/test/cpp_import_class_test.cpp @@ -9,8 +9,6 @@ #include -#if (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) - #include "../example/b2_workarounds.hpp" #include @@ -109,7 +107,3 @@ int main(int argc, char* argv[]) return boost::report_errors(); } - -#else -int main() {return 0;} -#endif diff --git a/test/cpp_import_test.cpp b/test/cpp_import_test.cpp index ea457bb8..a6f4002d 100644 --- a/test/cpp_import_test.cpp +++ b/test/cpp_import_test.cpp @@ -8,8 +8,6 @@ #include -#if (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) - #include "../example/b2_workarounds.hpp" #include @@ -76,6 +74,3 @@ int main(int argc, char* argv[]) return boost::report_errors(); } -#else -int main() {return 0;} -#endif diff --git a/test/cpp_load_test.cpp b/test/cpp_load_test.cpp index 07474d9f..ad11548b 100644 --- a/test/cpp_load_test.cpp +++ b/test/cpp_load_test.cpp @@ -10,8 +10,6 @@ #include #include -#if (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) - # include #include "../example/b2_workarounds.hpp" @@ -228,7 +226,3 @@ int main(int argc, char* argv[]) std::cerr << 28 << ' '; return boost::report_errors(); } - -#else -int main() {return 0;} -#endif diff --git a/test/cpp_mangle_test.cpp b/test/cpp_mangle_test.cpp index 7542ea6d..c7eb6142 100644 --- a/test/cpp_mangle_test.cpp +++ b/test/cpp_mangle_test.cpp @@ -8,8 +8,6 @@ #include -#if (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) - #include "../example/b2_workarounds.hpp" #include @@ -128,6 +126,3 @@ int main(int argc, char* argv[]) return boost::report_errors(); } -#else -int main() {return 0;} -#endif diff --git a/test/cpp_mangling.cpp b/test/cpp_mangling.cpp index 34ba9901..949679bd 100644 --- a/test/cpp_mangling.cpp +++ b/test/cpp_mangling.cpp @@ -8,11 +8,9 @@ #include -#if (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) #include -int main(int argc, char* argv[]) -{ +int main() { namespace parser = boost::dll::detail::parser; BOOST_TEST(parser::is_destructor_with_name("foo::~foo(void)")("public: __cdecl foo::~foo(void)")); @@ -154,6 +152,4 @@ int main(int argc, char* argv[]) return boost::report_errors(); } -#else -int main() {return 0;} -#endif + diff --git a/test/cpp_test_library.cpp b/test/cpp_test_library.cpp index 0c5544be..d8b37f33 100644 --- a/test/cpp_test_library.cpp +++ b/test/cpp_test_library.cpp @@ -9,8 +9,6 @@ #include -#if (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) - #include #include @@ -198,6 +196,3 @@ namespace space { template BOOST_SYMBOL_EXPORT int my_plugin::Func2<::space::my_plugin>(); template BOOST_SYMBOL_EXPORT int my_plugin::AFunc<::space::my_plugin>(); } - - -#endif diff --git a/test/ctti_type_name_parser_test.cpp b/test/ctti_type_name_parser_test.cpp index 4a5e6c50..ea5a89f9 100644 --- a/test/ctti_type_name_parser_test.cpp +++ b/test/ctti_type_name_parser_test.cpp @@ -8,7 +8,6 @@ #include -#if (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) #include "../example/b2_workarounds.hpp" #include @@ -165,10 +164,3 @@ main(int argc, char* argv[]) return boost::report_errors(); } -#else -int -main() -{ - return 0; -} -#endif diff --git a/test/library_info_test.cpp b/test/library_info_test.cpp index eeec29e5..57f4b17c 100644 --- a/test/library_info_test.cpp +++ b/test/library_info_test.cpp @@ -39,7 +39,8 @@ int main(int argc, char* argv[]) #if defined(__GNUC__) && __GNUC__ >= 4 && defined(__ELF__) BOOST_TEST(std::find(symb.begin(), symb.end(), "protected_function") != symb.end()); #endif - + + std::cout << "\n\n'boostdll' symbols:\n"; symb = lib_info.symbols("boostdll"); std::copy(symb.begin(), symb.end(), std::ostream_iterator(std::cout, "\n")); BOOST_TEST(std::find(symb.begin(), symb.end(), "const_integer_g_alias") != symb.end()); @@ -48,6 +49,7 @@ int main(int argc, char* argv[]) BOOST_TEST(std::find(symb.begin(), symb.end(), "say_hello") == symb.end()); BOOST_TEST(lib_info.symbols(std::string("boostdll")) == symb); + std::cout << "\n\n'empty' symbols:\n"; std::vector empty = lib_info.symbols("empty"); BOOST_TEST(empty.empty() == true); diff --git a/test/link.hpp b/test/link.hpp index 3005a74b..6d05e4fc 100644 --- a/test/link.hpp +++ b/test/link.hpp @@ -9,13 +9,8 @@ #include -#if (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) - #include #include #include -#endif - - #include diff --git a/test/template_method_linux_test.cpp b/test/template_method_linux_test.cpp index bd025057..2481cd59 100644 --- a/test/template_method_linux_test.cpp +++ b/test/template_method_linux_test.cpp @@ -6,7 +6,6 @@ // or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#if (__cplusplus > 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201402L) #include #include @@ -60,8 +59,3 @@ int main(int argc, char** argv) { return boost::report_errors(); } - - -#else -int main() {} -#endif