From 6cd4ccc60575a2c22b92595f816ab794454c51a9 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 8 Dec 2020 23:32:01 -0800 Subject: [PATCH] Fixing bug on MSVC, unbalanced pragma push/pop. Improved leaf.hpp generation. --- LICENSE => LICENSE_1_0.txt | 46 +-- gen/generate_single_header.py | 38 +- include/boost/leaf.hpp | 339 +----------------- include/boost/leaf/capture.hpp | 28 +- include/boost/leaf/common.hpp | 28 +- include/boost/leaf/context.hpp | 28 +- include/boost/leaf/detail/all.hpp | 11 +- include/boost/leaf/detail/config.hpp | 28 +- include/boost/leaf/detail/demangle.hpp | 28 +- include/boost/leaf/detail/function_traits.hpp | 28 +- include/boost/leaf/detail/optional.hpp | 28 +- include/boost/leaf/detail/print.hpp | 28 +- include/boost/leaf/error.hpp | 28 +- include/boost/leaf/exception.hpp | 28 +- include/boost/leaf/handle_errors.hpp | 28 +- include/boost/leaf/on_error.hpp | 28 +- include/boost/leaf/pred.hpp | 28 +- include/boost/leaf/result.hpp | 28 +- meson.build | 20 +- 19 files changed, 313 insertions(+), 533 deletions(-) rename LICENSE => LICENSE_1_0.txt (98%) diff --git a/LICENSE b/LICENSE_1_0.txt similarity index 98% rename from LICENSE rename to LICENSE_1_0.txt index 1dad8e9..36b7cd9 100644 --- a/LICENSE +++ b/LICENSE_1_0.txt @@ -1,23 +1,23 @@ -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/gen/generate_single_header.py b/gen/generate_single_header.py index 5ca10f6..cdc546b 100644 --- a/gen/generate_single_header.py +++ b/gen/generate_single_header.py @@ -29,9 +29,11 @@ included = [] def append(input_file_name, input_file, output_file, regex_includes, include_folder): line_count = 1 + last_line_was_empty = False for line in input_file: - result = regex_includes.search(line) line_count += 1 + this_line_is_empty = (line=='\n') + result = regex_includes.search(line) if result: next_input_file_name = result.group("include") if next_input_file_name not in included: @@ -40,9 +42,15 @@ def append(input_file_name, input_file, output_file, regex_includes, include_fol with open(os.path.join(include_folder, next_input_file_name), "r") as next_input_file: output_file.write('// >>> %s#line 1 "%s"\n' % (line, next_input_file_name)) append(next_input_file_name, next_input_file, output_file, regex_includes, include_folder) - output_file.write('// <<< %s#line %d "%s"\n' % (line, line_count, input_file_name)) + if not ('include/boost/leaf/detail/all.hpp' in input_file_name): + output_file.write('// <<< %s#line %d "%s"\n' % (line, line_count, input_file_name)) else: + if '///' in line: + continue + if this_line_is_empty and last_line_was_empty: + continue output_file.write(line) + last_line_was_empty = this_line_is_empty def _main(): parser = argparse.ArgumentParser( @@ -60,7 +68,33 @@ def _main(): regex_includes = re.compile(r"""^\s*#[\t\s]*include[\t\s]*("|\<)(?P%s.*)("|\>)""" % args.prefix) print("Rebuilding %s:" % args.input) with open(args.output, 'w') as output_file, open(args.input, 'r') as input_file: + output_file.write( + '#ifndef BOOST_LEAF_HPP_INCLUDED\n' + '#define BOOST_LEAF_HPP_INCLUDED\n' + '\n' + '// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc.\n' + '\n' + '// Distributed under the Boost Software License, Version 1.0. (See accompanying\n' + '// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n' + '\n' + '#ifndef BOOST_LEAF_ENABLE_WARNINGS\n' + '# if defined(_MSC_VER)\n' + '# pragma warning(push,1)\n' + '# elif defined(__clang__)\n' + '# pragma clang system_header\n' + '# elif (__GNUC__*100+__GNUC_MINOR__>301)\n' + '# pragma GCC system_header\n' + '# endif\n' + '#endif\n' + '\n' ) append(args.input, input_file, output_file, regex_includes, args.path) + output_file.write( + '\n' + '#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS)\n' + '#pragma warning(pop)\n' + '#endif\n' + '\n' + '#endif\n' ) if __name__ == "__main__": _main() diff --git a/include/boost/leaf.hpp b/include/boost/leaf.hpp index 4f28e58..df4dc77 100644 --- a/include/boost/leaf.hpp +++ b/include/boost/leaf.hpp @@ -6,86 +6,37 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef BOOST_LEAF_ENABLE_WARNINGS +# if defined(_MSC_VER) +# pragma warning(push,1) +# elif defined(__clang__) +# pragma clang system_header +# elif (__GNUC__*100+__GNUC_MINOR__>301) +# pragma GCC system_header +# endif +#endif + + // >>> #include #line 1 "boost/leaf/capture.hpp" #ifndef BOOST_LEAF_CAPTURE_HPP_INCLUDED #define BOOST_LEAF_CAPTURE_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - // >>> #include #line 1 "boost/leaf/exception.hpp" #ifndef BOOST_LEAF_EXCEPTION_HPP_INCLUDED #define BOOST_LEAF_EXCEPTION_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - // >>> #include #line 1 "boost/leaf/error.hpp" #ifndef BOOST_LEAF_ERROR_HPP_INCLUDED #define BOOST_LEAF_ERROR_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - // >>> #include #line 1 "boost/leaf/detail/function_traits.hpp" #ifndef BOOST_LEAF_DETAIL_FUNCTION_TRAITS_HPP_INCLUDED #define BOOST_LEAF_DETAIL_FUNCTION_TRAITS_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - // >>> #include #line 1 "boost/leaf/detail/mp11.hpp" #ifndef BOOST_LEAF_DETAIL_MP11_HPP_INCLUDED @@ -481,69 +432,22 @@ namespace boost { namespace leaf { #ifndef BOOST_LEAF_DETAIL_PRINT_HPP_INCLUDED #define BOOST_LEAF_DETAIL_PRINT_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - // >>> #include #line 1 "boost/leaf/detail/optional.hpp" #ifndef BOOST_LEAF_DETAIL_OPTIONAL_HPP_INCLUDED #define BOOST_LEAF_DETAIL_OPTIONAL_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - // >>> #include #line 1 "boost/leaf/detail/config.hpp" #ifndef BOOST_LEAF_CONFIG_HPP_INCLUDED #define BOOST_LEAF_CONFIG_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - // The following is based on Boost Config. // (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Martin Wille 2003. // (C) Copyright Guillaume Melquiond 2003. -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - -//////////////////////////////////////// - // Configure BOOST_LEAF_NO_EXCEPTIONS, unless already #defined #ifndef BOOST_LEAF_NO_EXCEPTIONS @@ -644,8 +548,6 @@ namespace boost { namespace leaf { # define BOOST_LEAF_NORETURN #endif -//////////////////////////////////////// - #ifndef BOOST_LEAF_DIAGNOSTICS # define BOOST_LEAF_DIAGNOSTICS 1 #endif @@ -654,16 +556,12 @@ namespace boost { namespace leaf { # error BOOST_LEAF_DIAGNOSTICS must be 0 or 1. #endif -//////////////////////////////////////// - #ifdef _MSC_VER # define BOOST_LEAF_ALWAYS_INLINE __forceinline #else # define BOOST_LEAF_ALWAYS_INLINE __attribute__((always_inline)) inline #endif -//////////////////////////////////////// - #ifndef BOOST_LEAF_NODISCARD # if __cplusplus >= 201703L # define BOOST_LEAF_NODISCARD [[nodiscard]] @@ -672,8 +570,6 @@ namespace boost { namespace leaf { # endif #endif -//////////////////////////////////////// - #ifndef BOOST_LEAF_CONSTEXPR # if __cplusplus > 201402L # define BOOST_LEAF_CONSTEXPR constexpr @@ -682,8 +578,6 @@ namespace boost { namespace leaf { # endif #endif -//////////////////////////////////////// - #ifndef BOOST_LEAF_ASSERT # ifdef BOOST_ASSERT # define BOOST_LEAF_ASSERT BOOST_ASSERT @@ -693,8 +587,6 @@ namespace boost { namespace leaf { # endif #endif -//////////////////////////////////////// - #ifndef BOOST_LEAF_NO_EXCEPTIONS # include # if (defined(__cpp_lib_uncaught_exceptions) && __cpp_lib_uncaught_exceptions >= 201411L) || (defined(_MSC_VER) && _MSC_VER >= 1900) @@ -923,8 +815,6 @@ namespace boost { namespace leaf { { }; - //////////////////////////////////////// - template struct has_printable_member_value: std::false_type { @@ -935,8 +825,6 @@ namespace boost { namespace leaf { { }; - //////////////////////////////////////// - template ::value, bool ValuePrintable=has_printable_member_value::value> struct diagnostic; @@ -1040,8 +928,6 @@ namespace boost { namespace leaf { } } -//////////////////////////////////////// - #ifdef BOOST_LEAF_NO_EXCEPTIONS namespace boost @@ -1073,8 +959,6 @@ namespace boost { namespace leaf { #endif -//////////////////////////////////////// - #ifdef BOOST_LEAF_NO_THREADS # define BOOST_LEAF_THREAD_LOCAL @@ -1099,8 +983,6 @@ namespace boost { namespace leaf { #endif -//////////////////////////////////////// - namespace boost { namespace leaf { #if BOOST_LEAF_DIAGNOSTICS @@ -1192,8 +1074,6 @@ namespace boost { namespace leaf { } } -//////////////////////////////////////// - namespace boost { namespace leaf { struct e_source_location @@ -1209,8 +1089,6 @@ namespace boost { namespace leaf { } }; - //////////////////////////////////////// - namespace leaf_detail { template @@ -1381,8 +1259,6 @@ namespace boost { namespace leaf { } } - //////////////////////////////////////// - namespace leaf_detail { template @@ -1419,8 +1295,6 @@ namespace boost { namespace leaf { } } - //////////////////////////////////////// - namespace leaf_detail { template ::arity> @@ -1457,8 +1331,6 @@ namespace boost { namespace leaf { }; } - //////////////////////////////////////// - namespace leaf_detail { class leaf_category final: public std::error_category @@ -1509,8 +1381,6 @@ namespace boost { namespace leaf { return res; } - //////////////////////////////////////// - class error_id; namespace leaf_detail @@ -1642,8 +1512,6 @@ namespace boost { namespace leaf { return leaf_detail::make_error_id(leaf_detail::current_id()); } - //////////////////////////////////////////// - class polymorphic_context { protected: @@ -1664,8 +1532,6 @@ namespace boost { namespace leaf { using context_ptr = std::shared_ptr; - //////////////////////////////////////////// - template class context_activator { @@ -1721,8 +1587,6 @@ namespace boost { namespace leaf { return context_activator(ctx); } - //////////////////////////////////////////// - template struct is_result_type: std::false_type { @@ -1745,8 +1609,6 @@ namespace boost { namespace leaf { #define BOOST_LEAF_EXCEPTION ::boost::leaf::leaf_detail::inject_loc{__FILE__,__LINE__,__FUNCTION__}+::boost::leaf::exception #define BOOST_LEAF_THROW_EXCEPTION ::boost::leaf::leaf_detail::throw_with_loc{__FILE__,__LINE__,__FUNCTION__}+::boost::leaf::exception -//////////////////////////////////////// - namespace boost { namespace leaf { namespace leaf_detail @@ -1768,8 +1630,6 @@ namespace boost { namespace leaf { } } -//////////////////////////////////////// - namespace boost { namespace leaf { namespace leaf_detail @@ -1871,21 +1731,6 @@ namespace boost { namespace leaf { #ifndef BOOST_LEAF_ON_ERROR_HPP_INCLUDED #define BOOST_LEAF_ON_ERROR_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - namespace boost { namespace leaf { @@ -1945,8 +1790,6 @@ namespace boost { namespace leaf { } }; - //////////////////////////////////////////// - namespace leaf_detail { template @@ -2351,8 +2194,6 @@ namespace boost { namespace leaf { return future_get_impl(is_result_tag().get())>(), fut); } - //////////////////////////////////////// - #ifndef BOOST_LEAF_NO_EXCEPTIONS template @@ -2414,28 +2255,11 @@ namespace boost { namespace leaf { } } #endif -// <<< #include -#line 10 "../../include/boost/leaf/detail/all.hpp" // >>> #include #line 1 "boost/leaf/common.hpp" #ifndef BOOST_LEAF_COMMON_HPP_INCLUDED #define BOOST_LEAF_COMMON_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - #include #include #ifdef _WIN32 @@ -2515,28 +2339,11 @@ namespace boost { namespace leaf { } } #endif -// <<< #include -#line 11 "../../include/boost/leaf/detail/all.hpp" // >>> #include #line 1 "boost/leaf/context.hpp" #ifndef BOOST_LEAF_CONTEXT_HPP_INCLUDED #define BOOST_LEAF_CONTEXT_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - namespace boost { namespace leaf { @@ -2667,8 +2474,6 @@ namespace boost { namespace leaf { }; } - //////////////////////////////////////// - namespace leaf_detail { template @@ -2724,8 +2529,6 @@ namespace boost { namespace leaf { }; } - //////////////////////////////////////////// - #if BOOST_LEAF_DIAGNOSTICS namespace leaf_detail @@ -2755,8 +2558,6 @@ namespace boost { namespace leaf { #endif - //////////////////////////////////////////// - namespace leaf_detail { template struct does_not_participate_in_context_deduction: std::false_type { }; @@ -2790,8 +2591,6 @@ namespace boost { namespace leaf { using deduce_e_tuple = typename deduce_e_tuple_impl>::type>::type; } - //////////////////////////////////////////// - template class context { @@ -2896,8 +2695,6 @@ namespace boost { namespace leaf { BOOST_LEAF_CONSTEXPR R handle_error( error_id, H && ... ); }; - //////////////////////////////////////// - namespace leaf_detail { template @@ -2948,8 +2745,6 @@ namespace boost { namespace leaf { template using context_type_from_handlers = typename leaf_detail::context_type_from_handlers_impl::type; - //////////////////////////////////////////// - template BOOST_LEAF_CONSTEXPR inline context_type_from_handlers make_context() noexcept { @@ -2962,8 +2757,6 @@ namespace boost { namespace leaf { return { }; } - //////////////////////////////////////////// - template inline context_ptr make_shared_context() noexcept { @@ -2979,38 +2772,16 @@ namespace boost { namespace leaf { } } #endif -// <<< #include -#line 12 "../../include/boost/leaf/detail/all.hpp" // >>> #include #line 1 "boost/leaf/handle_errors.hpp" #ifndef BOOST_LEAF_HANDLE_ERRORS_HPP_INCLUDED #define BOOST_LEAF_HANDLE_ERRORS_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - // >>> #include #line 1 "boost/leaf/detail/demangle.hpp" #ifndef BOOST_LEAF_DETAIL_DEMANGLE_HPP_INCLUDED #define BOOST_LEAF_DETAIL_DEMANGLE_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - // core::demangle // // Copyright 2014 Peter Dimov @@ -3020,16 +2791,6 @@ namespace boost { namespace leaf { // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - #if !defined(_MSC_VER) # if defined(__has_include) && __has_include() # define BOOST_LEAF_HAS_CXXABI_H @@ -3221,8 +2982,6 @@ namespace boost { namespace leaf { } }; - //////////////////////////////////////// - #if BOOST_LEAF_DIAGNOSTICS class diagnostic_info: public error_info @@ -3330,8 +3089,6 @@ namespace boost { namespace leaf { #endif - //////////////////////////////////////// - #if BOOST_LEAF_DIAGNOSTICS class verbose_diagnostic_info: public error_info @@ -3426,7 +3183,6 @@ namespace boost { namespace leaf { } }; - template <> struct handler_argument_traits: handler_argument_always_available { @@ -3440,8 +3196,6 @@ namespace boost { namespace leaf { #endif - //////////////////////////////////////// - namespace leaf_detail { template @@ -3572,8 +3326,6 @@ namespace boost { namespace leaf { } } - //////////////////////////////////////// - namespace leaf_detail { template @@ -3627,8 +3379,6 @@ namespace boost { namespace leaf { }; } - //////////////////////////////////////// - namespace leaf_detail { template @@ -3648,8 +3398,6 @@ namespace boost { namespace leaf { }; } - //////////////////////////////////////// - namespace leaf_detail { template @@ -3753,8 +3501,6 @@ namespace boost { namespace leaf { } } - //////////////////////////////////////// - template template BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE @@ -3777,8 +3523,6 @@ namespace boost { namespace leaf { return leaf_detail::handle_error_(tup(), error_info(id), std::forward(h)...); } - //////////////////////////////////////// - #ifdef BOOST_LEAF_NO_EXCEPTIONS template @@ -4019,28 +3763,11 @@ namespace boost { namespace leaf { } } #endif -// <<< #include -#line 15 "../../include/boost/leaf/detail/all.hpp" // >>> #include #line 1 "boost/leaf/pred.hpp" #ifndef BOOST_LEAF_PRED_HPP_INCLUDED #define BOOST_LEAF_PRED_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - #if __cplusplus >= 201703L # define BOOST_LEAF_MATCH_ARGS(et,v1,v) auto v1, auto... v @@ -4082,8 +3809,6 @@ namespace boost { namespace leaf { } } - //////////////////////////////////////// - template struct condition { @@ -4105,8 +3830,6 @@ namespace boost { namespace leaf { } #endif - //////////////////////////////////////// - namespace leaf_detail { template @@ -4158,8 +3881,6 @@ namespace boost { namespace leaf { { }; - //////////////////////////////////////// - namespace leaf_detail { template @@ -4210,8 +3931,6 @@ namespace boost { namespace leaf { { }; - //////////////////////////////////////// - #if __cplusplus >= 201703L template struct match_member; @@ -4234,8 +3953,6 @@ namespace boost { namespace leaf { }; #endif - //////////////////////////////////////// - template struct if_not { @@ -4254,9 +3971,6 @@ namespace boost { namespace leaf { { }; - //////////////////////////////////////// - - #ifndef BOOST_LEAF_NO_EXCEPTIONS namespace leaf_detail @@ -4318,28 +4032,11 @@ namespace boost { namespace leaf { } } #endif -// <<< #include -#line 17 "../../include/boost/leaf/detail/all.hpp" // >>> #include #line 1 "boost/leaf/result.hpp" #ifndef BOOST_LEAF_RESULT_HPP_INCLUDED #define BOOST_LEAF_RESULT_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif - #include namespace boost { namespace leaf { @@ -4362,8 +4059,6 @@ namespace boost { namespace leaf { } }; - //////////////////////////////////////// - namespace leaf_detail { template @@ -4435,8 +4130,6 @@ namespace boost { namespace leaf { }; } - //////////////////////////////////////// - template class result { @@ -4717,8 +4410,6 @@ namespace boost { namespace leaf { } }; - //////////////////////////////////////// - namespace leaf_detail { struct void_ { }; @@ -4790,8 +4481,6 @@ namespace boost { namespace leaf { using base::load; }; - //////////////////////////////////////// - template struct is_result_type; @@ -4803,7 +4492,9 @@ namespace boost { namespace leaf { } } #endif -// <<< #include -#line 18 "../../include/boost/leaf/detail/all.hpp" + +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/include/boost/leaf/capture.hpp b/include/boost/leaf/capture.hpp index 8690683..dadc9bf 100644 --- a/include/boost/leaf/capture.hpp +++ b/include/boost/leaf/capture.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_CAPTURE_HPP_INCLUDED #define BOOST_LEAF_CAPTURE_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include #include @@ -297,4 +297,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/common.hpp b/include/boost/leaf/common.hpp index e4252f5..614f7f3 100644 --- a/include/boost/leaf/common.hpp +++ b/include/boost/leaf/common.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_COMMON_HPP_INCLUDED #define BOOST_LEAF_COMMON_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include #include @@ -95,4 +95,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/context.hpp b/include/boost/leaf/context.hpp index d720efa..d61b30d 100644 --- a/include/boost/leaf/context.hpp +++ b/include/boost/leaf/context.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_CONTEXT_HPP_INCLUDED #define BOOST_LEAF_CONTEXT_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include @@ -458,4 +458,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/detail/all.hpp b/include/boost/leaf/detail/all.hpp index a645114..781b28f 100644 --- a/include/boost/leaf/detail/all.hpp +++ b/include/boost/leaf/detail/all.hpp @@ -1,10 +1,7 @@ -#ifndef BOOST_LEAF_HPP_INCLUDED -#define BOOST_LEAF_HPP_INCLUDED +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. - -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include @@ -15,5 +12,3 @@ #include #include #include - -#endif diff --git a/include/boost/leaf/detail/config.hpp b/include/boost/leaf/detail/config.hpp index c52cda2..e2501f5 100644 --- a/include/boost/leaf/detail/config.hpp +++ b/include/boost/leaf/detail/config.hpp @@ -1,10 +1,10 @@ #ifndef BOOST_LEAF_CONFIG_HPP_INCLUDED #define BOOST_LEAF_CONFIG_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // The following is based on Boost Config. @@ -12,15 +12,15 @@ // (C) Copyright Martin Wille 2003. // (C) Copyright Guillaume Melquiond 2003. -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// //////////////////////////////////////// @@ -184,4 +184,8 @@ # endif #endif +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/detail/demangle.hpp b/include/boost/leaf/detail/demangle.hpp index 4622564..3695196 100644 --- a/include/boost/leaf/detail/demangle.hpp +++ b/include/boost/leaf/detail/demangle.hpp @@ -1,10 +1,10 @@ #ifndef BOOST_LEAF_DETAIL_DEMANGLE_HPP_INCLUDED #define BOOST_LEAF_DETAIL_DEMANGLE_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // core::demangle // @@ -15,15 +15,15 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #if !defined(_MSC_VER) # if defined(__has_include) && __has_include() @@ -125,4 +125,8 @@ namespace boost { namespace leaf { # undef BOOST_LEAF_HAS_CXXABI_H #endif +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/detail/function_traits.hpp b/include/boost/leaf/detail/function_traits.hpp index 06ba4e7..e11e578 100644 --- a/include/boost/leaf/detail/function_traits.hpp +++ b/include/boost/leaf/detail/function_traits.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_DETAIL_FUNCTION_TRAITS_HPP_INCLUDED #define BOOST_LEAF_DETAIL_FUNCTION_TRAITS_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include #include @@ -97,4 +97,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/detail/optional.hpp b/include/boost/leaf/detail/optional.hpp index b3a77cc..894db02 100644 --- a/include/boost/leaf/detail/optional.hpp +++ b/include/boost/leaf/detail/optional.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_DETAIL_OPTIONAL_HPP_INCLUDED #define BOOST_LEAF_DETAIL_OPTIONAL_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include #include @@ -177,4 +177,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/detail/print.hpp b/include/boost/leaf/detail/print.hpp index cc6aa00..632e500 100644 --- a/include/boost/leaf/detail/print.hpp +++ b/include/boost/leaf/detail/print.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_DETAIL_PRINT_HPP_INCLUDED #define BOOST_LEAF_DETAIL_PRINT_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include #include @@ -131,4 +131,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/error.hpp b/include/boost/leaf/error.hpp index 9d18e08..fb96c0c 100644 --- a/include/boost/leaf/error.hpp +++ b/include/boost/leaf/error.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_ERROR_HPP_INCLUDED #define BOOST_LEAF_ERROR_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include #include @@ -768,4 +768,8 @@ namespace boost { namespace leaf { #undef BOOST_LEAF_THREAD_LOCAL +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/exception.hpp b/include/boost/leaf/exception.hpp index c40ea1e..5480ace 100644 --- a/include/boost/leaf/exception.hpp +++ b/include/boost/leaf/exception.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_EXCEPTION_HPP_INCLUDED #define BOOST_LEAF_EXCEPTION_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include #include @@ -140,4 +140,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/handle_errors.hpp b/include/boost/leaf/handle_errors.hpp index 249076d..fc5eee1 100644 --- a/include/boost/leaf/handle_errors.hpp +++ b/include/boost/leaf/handle_errors.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_HANDLE_ERRORS_HPP_INCLUDED #define BOOST_LEAF_HANDLE_ERRORS_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include #include @@ -904,4 +904,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/on_error.hpp b/include/boost/leaf/on_error.hpp index 36afae6..de282b6 100644 --- a/include/boost/leaf/on_error.hpp +++ b/include/boost/leaf/on_error.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_ON_ERROR_HPP_INCLUDED #define BOOST_LEAF_ON_ERROR_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include @@ -262,4 +262,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/pred.hpp b/include/boost/leaf/pred.hpp index 776e138..c0d5874 100644 --- a/include/boost/leaf/pred.hpp +++ b/include/boost/leaf/pred.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_PRED_HPP_INCLUDED #define BOOST_LEAF_PRED_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include @@ -293,4 +293,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/include/boost/leaf/result.hpp b/include/boost/leaf/result.hpp index 57d9eff..ea45363 100644 --- a/include/boost/leaf/result.hpp +++ b/include/boost/leaf/result.hpp @@ -1,20 +1,20 @@ #ifndef BOOST_LEAF_RESULT_HPP_INCLUDED #define BOOST_LEAF_RESULT_HPP_INCLUDED -// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. +/// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +/// Distributed under the Boost Software License, Version 1.0. (See accompanying +/// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_LEAF_ENABLE_WARNINGS -# if defined(__clang__) -# pragma clang system_header -# elif (__GNUC__*100+__GNUC_MINOR__>301) -# pragma GCC system_header -# elif defined(_MSC_VER) -# pragma warning(push,1) -# endif -#endif +#ifndef BOOST_LEAF_ENABLE_WARNINGS /// +# if defined(_MSC_VER) /// +# pragma warning(push,1) /// +# elif defined(__clang__) /// +# pragma clang system_header /// +# elif (__GNUC__*100+__GNUC_MINOR__>301) /// +# pragma GCC system_header /// +# endif /// +#endif /// #include #include @@ -479,4 +479,8 @@ namespace boost { namespace leaf { } } +#if defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) /// +#pragma warning(pop) /// +#endif /// + #endif diff --git a/meson.build b/meson.build index b531756..850deda 100644 --- a/meson.build +++ b/meson.build @@ -268,16 +268,20 @@ endif if option_enable_benchmarks + if get_option('optimization')=='0' + error('The option leaf_enable_benchmarks requires optimizations to be enabled. Aborting.') + endif + if option_exceptions error('The option leaf_enable_benchmarks requires the built-in option cpp_eh set to none. Aborting.') - else - dep_tl_expected = subproject('tl_expected').get_variable('headers') - executable('deep_stack_tl', 'benchmark/deep_stack_other.cpp', override_options: ['cpp_std=c++17'], cpp_args: '-DBENCHMARK_WHAT=0', dependencies: [dep_tl_expected] ) - executable('deep_stack_leaf', 'benchmark/deep_stack_leaf.cpp', dependencies: [leaf], override_options: ['cpp_std=c++17'], cpp_args: '-DBOOST_LEAF_DIAGNOSTICS=0') - if option_boost - executable('deep_stack_result', 'benchmark/deep_stack_other.cpp', dependencies: [dep_boost], override_options: ['cpp_std=c++17'], cpp_args: '-DBENCHMARK_WHAT=1' ) - executable('deep_stack_outcome', 'benchmark/deep_stack_other.cpp', dependencies: [dep_boost], override_options: ['cpp_std=c++17'], cpp_args: '-DBENCHMARK_WHAT=2' ) - endif + endif + + dep_tl_expected = subproject('tl_expected').get_variable('headers') + executable('deep_stack_tl', 'benchmark/deep_stack_other.cpp', override_options: ['cpp_std=c++17'], cpp_args: '-DBENCHMARK_WHAT=0', dependencies: [dep_tl_expected] ) + executable('deep_stack_leaf', 'benchmark/deep_stack_leaf.cpp', dependencies: [leaf], override_options: ['cpp_std=c++17'], cpp_args: '-DBOOST_LEAF_DIAGNOSTICS=0') + if option_boost + executable('deep_stack_result', 'benchmark/deep_stack_other.cpp', dependencies: [dep_boost], override_options: ['cpp_std=c++17'], cpp_args: '-DBENCHMARK_WHAT=1' ) + executable('deep_stack_outcome', 'benchmark/deep_stack_other.cpp', dependencies: [dep_boost], override_options: ['cpp_std=c++17'], cpp_args: '-DBENCHMARK_WHAT=2' ) endif endif