passenger 6.0.1 → 6.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +145 -18
- data/CONTRIBUTORS +6 -0
- data/bin/passenger-install-nginx-module +1 -1
- data/bin/passenger-status +15 -0
- data/build/misc.rb +3 -1
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +56 -3
- data/dev/copy_boost_headers +1 -0
- data/package.json +1 -1
- data/passenger.gemspec +9 -1
- data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.css +0 -0
- data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.js +0 -0
- data/resources/templates/error_renderer/with_details/src/bootstrap/config.json +0 -0
- data/resources/templates/standalone/http.erb +2 -0
- data/resources/templates/standalone/server.erb +1 -0
- data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +1 -0
- data/src/agent/Core/ApplicationPool/Options.h +10 -0
- data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
- data/src/agent/Core/Config.h +14 -1
- data/src/agent/Core/Controller.h +1 -0
- data/src/agent/Core/Controller/Config.h +5 -1
- data/src/agent/Core/Controller/ForwardResponse.cpp +13 -0
- data/src/agent/Core/Controller/InitRequest.cpp +3 -0
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -0
- data/src/agent/Core/CoreMain.cpp +2 -1
- data/src/agent/Core/OptionParser.h +3 -0
- data/src/agent/Core/SpawningKit/Context.h +1 -0
- data/src/agent/Core/SpawningKit/Handshake/Prepare.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +5 -2
- data/src/agent/TempDirToucher/TempDirToucherMain.cpp +2 -0
- data/src/agent/Watchdog/Config.h +15 -1
- data/src/agent/Watchdog/WatchdogMain.cpp +7 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +10 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +10 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +30 -0
- data/src/apache2_module/Hooks.cpp +6 -0
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +20 -0
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +24 -0
- data/src/cxx_supportlib/Constants.h +2 -1
- data/src/cxx_supportlib/LoggingKit/Config.h +2 -0
- data/src/cxx_supportlib/LoggingKit/Implementation.cpp +15 -9
- data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParser.h +1 -1
- data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +20 -19
- data/src/cxx_supportlib/WebSocketCommandReverseServer.h +11 -7
- data/src/cxx_supportlib/oxt/system_calls.cpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/finder.hpp +0 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffer.hpp +46 -37
- data/src/cxx_supportlib/vendor-modified/boost/asio/connect.hpp +16 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +45 -26
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/future.hpp +33 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/is_buffer_sequence.hpp +38 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/io_context.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/use_future.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/bad_address_cast.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver.hpp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_results.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/packaged_task.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/read.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_at.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_until.hpp +8 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/context_base.hpp +17 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/context.ipp +50 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/thread_pool.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/use_future.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/write.hpp +4 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/write_at.hpp +5 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_x86_dcas.hpp +13 -12
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/chrono.hpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp +34 -34
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/thread_clock.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/posix/chrono.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp +27 -27
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/posix/thread_clock.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/system.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_io.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/circular_buffer.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/allocators.hpp +89 -0
- data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/base.hpp +83 -74
- data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/details.hpp +21 -33
- data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/space_optimized.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/concept/assert.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/concept/detail/general.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/concept/usage.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/concept_check.hpp +19 -19
- data/src/cxx_supportlib/vendor-modified/boost/config/auto_link.hpp +8 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/borland.hpp +5 -2
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/codegear.hpp +6 -2
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/comeau.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/common_edg.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/cray.hpp +368 -52
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/digitalmars.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc.hpp +6 -3
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc_xml.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/greenhills.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/hp_acc.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/intel.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/kai.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/metrowerks.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/mpw.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/nvcc.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/pathscale.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sunpro_cc.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/vacpp.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +9 -4
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp_zos.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/detail/select_compiler_config.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/config/detail/suffix.hpp +13 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/dinkumware.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcpp.hpp +14 -4
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libstdcpp3.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/adaptive_pool.hpp +262 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +4 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool.hpp +22 -19
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool_impl.hpp +833 -459
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +24 -6
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/allocator_version_traits.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/compare_functors.hpp +61 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +33 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +132 -41
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterator.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/math_functions.hpp +54 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/mpl.hpp +58 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/multiallocation_chain.hpp +28 -23
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_alloc_holder.hpp +167 -115
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/std_fwd.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/thread_mutex.hpp +181 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +167 -29
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/type_traits.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/variadic_templates_tools.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +18 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +389 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +262 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +52 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +364 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/monotonic_buffer_resource.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/resource_adaptor.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/synchronized_pool_resource.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +286 -6
- data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +56 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +43 -6
- data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +100 -31
- data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +126 -69
- data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +75 -51
- data/src/cxx_supportlib/vendor-modified/boost/core/empty_value.hpp +136 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/exchange.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/explicit_operator_bool.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +101 -130
- data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/core/noncopyable.hpp +16 -1
- data/src/cxx_supportlib/vendor-modified/boost/core/quick_exit.hpp +59 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/ref.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/core/swap.hpp +9 -2
- data/src/cxx_supportlib/vendor-modified/boost/core/typeinfo.hpp +26 -10
- data/src/cxx_supportlib/vendor-modified/boost/date_time/compiler_config.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/posix_time_duration.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_duration.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/detail/basic_pointerbuf.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/detail/indirect_traits.hpp +38 -47
- data/src/cxx_supportlib/vendor-modified/boost/detail/lcast_precision.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/detail/reference_content.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/exception/exception.hpp +62 -58
- data/src/cxx_supportlib/vendor-modified/boost/function.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/function/function_base.hpp +29 -29
- data/src/cxx_supportlib/vendor-modified/boost/function/function_template.hpp +38 -40
- data/src/cxx_supportlib/vendor-modified/boost/integer/common_factor_rt.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree_algorithms.hpp +44 -44
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree_algorithms.hpp +39 -39
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/circular_list_algorithms.hpp +15 -15
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/circular_slist_algorithms.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/derivation_value_traits.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/any_node_and_algorithms.hpp +14 -14
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/avltree_node.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/common_slist_algorithms.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/list_iterator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/list_node.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/node_cloner_disposer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/rbtree_node.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/simple_disposers.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/slist_iterator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/slist_node.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/tree_iterator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/tree_node.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/tree_value_compare.hpp +33 -14
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +12 -12
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/linear_slist_algorithms.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_plus_bits.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree_algorithms.hpp +39 -39
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/sgtree_algorithms.hpp +61 -61
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/slist.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/splaytree_algorithms.hpp +66 -66
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap_algorithms.hpp +54 -54
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/unordered_set.hpp +6 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/unordered_set_hook.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/iterator/advance.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/iterator/distance.hpp +65 -0
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/bad_lexical_cast.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical.hpp +23 -23
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/inf_nan.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/is_character.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_char_constants.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/widest_char.hpp +5 -2
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/try_lexical_convert.hpp +18 -13
- data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/cregex.cpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/libs/system/src/error_code.cpp +16 -5
- data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/future.cpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/thread.cpp +14 -8
- data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/tss_null.cpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/math/special_functions/detail/fp_traits.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/math/special_functions/math_fwd.hpp +27 -0
- data/src/cxx_supportlib/vendor-modified/boost/math/tools/config.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/adaptive_merge.hpp +29 -6
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/adaptive_sort.hpp +12 -3
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/adaptive_sort_merge.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/move.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/algorithm.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/core.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/meta_utils.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/mpl/assert.hpp +23 -3
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/experimental_traits.hpp +9 -3
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/old_optional_implementation.hpp +10 -11
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_reference_spec.hpp +20 -1
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_trivially_copyable_base.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/optional/optional.hpp +211 -101
- data/src/cxx_supportlib/vendor-modified/boost/parameter/python.hpp +5 -6
- data/src/cxx_supportlib/vendor-modified/boost/pool/detail/mutex.hpp +119 -25
- data/src/cxx_supportlib/vendor-modified/boost/predef/architecture.h +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/architecture/arm.h +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/architecture/ptx.h +44 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/compiler.h +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/compiler/compaq.h +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/compiler/nvcc.h +73 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/detail/endian_compat.h +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/language.h +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/language/cuda.h +52 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/make.h +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/os/cygwin.h +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/other/endian.h +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/predef/version.h +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/config/config.hpp +17 -8
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/stringize.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/wstringize.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/gray_coded_qrng.hpp +166 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/niederreiter_base2_table.hpp +513 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/qrng_base.hpp +291 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/sobol_table.hpp +4106 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/faure.hpp +367 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/niederreiter_base2.hpp +360 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/sobol.hpp +237 -0
- data/src/cxx_supportlib/vendor-modified/boost/range/as_literal.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/range/begin.hpp +13 -5
- data/src/cxx_supportlib/vendor-modified/boost/range/concepts.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/range/detail/common.hpp +1 -3
- data/src/cxx_supportlib/vendor-modified/boost/range/detail/implementation_help.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/range/distance.hpp +11 -5
- data/src/cxx_supportlib/vendor-modified/boost/range/end.hpp +14 -6
- data/src/cxx_supportlib/vendor-modified/boost/range/has_range_iterator.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/ratio/config.hpp +6 -2
- data/src/cxx_supportlib/vendor-modified/boost/rational.hpp +55 -37
- data/src/cxx_supportlib/vendor-modified/boost/regex/concepts.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/config.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex.hpp +7 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex_creator.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex_parser.hpp +5 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/fileiter.hpp +0 -3
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/instances.hpp +15 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/match_flags.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/match_results.hpp +12 -3
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher.hpp +7 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_common.hpp +7 -3
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_non_recursive.hpp +6 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_format.hpp +0 -5
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_iterator.hpp +0 -8
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_raw_buffer.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_split.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_token_iterator.hpp +0 -8
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_traits_defaults.hpp +12 -11
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_workaround.hpp +7 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/u32regex_iterator.hpp +1 -9
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/u32regex_token_iterator.hpp +2 -10
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/w32_regex_traits.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/allocate_shared_array.hpp +60 -115
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/local_counted_base.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_aix.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_clang.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_nt.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_pt.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_solaris.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_spin.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_sync.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_impl.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/yield_k.hpp +14 -8
- data/src/cxx_supportlib/vendor-modified/boost/system/config.hpp +4 -24
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/config.hpp +57 -0
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/generic_category.hpp +101 -0
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/std_interoperability.hpp +141 -0
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/system_category_posix.hpp +132 -0
- data/src/cxx_supportlib/vendor-modified/boost/system/error_code.hpp +775 -588
- data/src/cxx_supportlib/vendor-modified/boost/system/system_error.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/config.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/move.hpp +13 -6
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/nullary_function.hpp +8 -3
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/thread.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/thread_safety.hpp +160 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/tss_hooks.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/exceptions.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/thread/executors/basic_thread_pool.hpp +24 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/future.hpp +10 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/lock_guard.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/thread/lockable_traits.hpp +31 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/condition_variable.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/condition_variable_fwd.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/mutex.hpp +8 -53
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/pthread_mutex_scoped_lock.hpp +73 -4
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/recursive_mutex.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/thread_data.hpp +14 -9
- data/src/cxx_supportlib/vendor-modified/boost/thread/xtime.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/throw_exception.hpp +9 -8
- data/src/cxx_supportlib/vendor-modified/boost/token_functions.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_index/stl_type_index.hpp +21 -19
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/common_arithmetic_type.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/config.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/detector.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/has_postfix_operator.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/has_prefix_operator.hpp +72 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_function_cxx_03.hpp +108 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_function_cxx_11.hpp +501 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_function_msvc10_fix.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_likely_lambda.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_member_function_pointer_cxx_03.hpp +117 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_member_function_pointer_cxx_11.hpp +557 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detected.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detected_or.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/enable_if.hpp +37 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_dereference.hpp +344 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_minus.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_minus_assign.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_plus_assign.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_post_decrement.hpp +21 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_post_increment.hpp +21 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_pre_decrement.hpp +21 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_pre_increment.hpp +22 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_move_assign.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_move_constructor.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/integral_constant.hpp +5 -15
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/intrinsics.hpp +16 -6
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_complete.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_copy_assignable.hpp +3 -4
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_copy_constructible.hpp +4 -6
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_detected.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_detected_convertible.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_detected_exact.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_final.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_function.hpp +4 -79
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_member_function_pointer.hpp +3 -97
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_noncopyable.hpp +39 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_nothrow_move_assignable.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_nothrow_move_constructible.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_rvalue_reference.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_virtual_base_of.hpp +104 -63
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/make_void.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/nonesuch.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/typeof/constant.hpp +26 -0
- data/src/cxx_supportlib/vendor-modified/boost/typeof/dmc/typeof_impl.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/typeof/encode_decode.hpp +0 -3
- data/src/cxx_supportlib/vendor-modified/boost/typeof/encode_decode_params.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/typeof/int_encoding.hpp +4 -5
- data/src/cxx_supportlib/vendor-modified/boost/typeof/modifiers.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/typeof/msvc/typeof_impl.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/typeof/native.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/typeof/pointers_data_members.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/typeof/register_functions_iterate.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/typeof/register_mem_functions.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/typeof/template_encoding.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/typeof/template_template_param.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/typeof/type_encoding.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/typeof/typeof_impl.hpp +16 -16
- data/src/cxx_supportlib/vendor-modified/boost/typeof/vector.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/typeof/vector100.hpp +201 -201
- data/src/cxx_supportlib/vendor-modified/boost/typeof/vector150.hpp +301 -301
- data/src/cxx_supportlib/vendor-modified/boost/typeof/vector200.hpp +401 -401
- data/src/cxx_supportlib/vendor-modified/boost/typeof/vector50.hpp +101 -101
- data/src/cxx_supportlib/vendor-modified/boost/utility/detail/minstd_rand.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/utility/string_ref.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/utility/string_view.hpp +26 -6
- data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
- data/src/helper-scripts/prespawn +1 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +40 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +26 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +48 -0
- data/src/nginx_module/Configuration.c +6 -2
- data/src/nginx_module/ContentHandler.c +5 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +15 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +15 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +28 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +6 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +11 -0
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +11 -0
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +23 -0
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +8 -0
- data/src/nginx_module/ngx_http_passenger_module.c +2 -0
- data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/logger.js +0 -0
- data/src/ruby_native_extension/extconf.rb +7 -0
- data/src/ruby_supportlib/phusion_passenger.rb +7 -7
- data/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb +8 -0
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +23 -0
- data/src/ruby_supportlib/phusion_passenger/constants.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +1 -3
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +37 -0
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +10 -0
- data/src/ruby_supportlib/phusion_passenger/request_handler.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +5 -0
- data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +11 -0
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +3 -0
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/tee_input.rb +6 -0
- data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +15 -11
- metadata +42 -8
- data/src/cxx_supportlib/vendor-modified/boost/call_traits.hpp +0 -20
- data/src/cxx_supportlib/vendor-modified/boost/detail/call_traits.hpp +0 -172
- data/src/cxx_supportlib/vendor-modified/boost/detail/no_exceptions_support.hpp +0 -17
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_code.ipp +0 -496
@@ -0,0 +1,132 @@
|
|
1
|
+
// POSIX-specific implementation details of system_error_category
|
2
|
+
//
|
3
|
+
// Copyright 2018 Peter Dimov
|
4
|
+
//
|
5
|
+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
6
|
+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
7
|
+
//
|
8
|
+
// See library home page at http://www.boost.org/libs/system
|
9
|
+
|
10
|
+
namespace boost
|
11
|
+
{
|
12
|
+
|
13
|
+
namespace system
|
14
|
+
{
|
15
|
+
|
16
|
+
namespace detail
|
17
|
+
{
|
18
|
+
|
19
|
+
inline bool is_generic_value( int ev ) BOOST_NOEXCEPT
|
20
|
+
{
|
21
|
+
using namespace errc;
|
22
|
+
|
23
|
+
static int const gen[] =
|
24
|
+
{
|
25
|
+
success,
|
26
|
+
address_family_not_supported,
|
27
|
+
address_in_use,
|
28
|
+
address_not_available,
|
29
|
+
already_connected,
|
30
|
+
argument_list_too_long,
|
31
|
+
argument_out_of_domain,
|
32
|
+
bad_address,
|
33
|
+
bad_file_descriptor,
|
34
|
+
bad_message,
|
35
|
+
broken_pipe,
|
36
|
+
connection_aborted,
|
37
|
+
connection_already_in_progress,
|
38
|
+
connection_refused,
|
39
|
+
connection_reset,
|
40
|
+
cross_device_link,
|
41
|
+
destination_address_required,
|
42
|
+
device_or_resource_busy,
|
43
|
+
directory_not_empty,
|
44
|
+
executable_format_error,
|
45
|
+
file_exists,
|
46
|
+
file_too_large,
|
47
|
+
filename_too_long,
|
48
|
+
function_not_supported,
|
49
|
+
host_unreachable,
|
50
|
+
identifier_removed,
|
51
|
+
illegal_byte_sequence,
|
52
|
+
inappropriate_io_control_operation,
|
53
|
+
interrupted,
|
54
|
+
invalid_argument,
|
55
|
+
invalid_seek,
|
56
|
+
io_error,
|
57
|
+
is_a_directory,
|
58
|
+
message_size,
|
59
|
+
network_down,
|
60
|
+
network_reset,
|
61
|
+
network_unreachable,
|
62
|
+
no_buffer_space,
|
63
|
+
no_child_process,
|
64
|
+
no_link,
|
65
|
+
no_lock_available,
|
66
|
+
no_message_available,
|
67
|
+
no_message,
|
68
|
+
no_protocol_option,
|
69
|
+
no_space_on_device,
|
70
|
+
no_stream_resources,
|
71
|
+
no_such_device_or_address,
|
72
|
+
no_such_device,
|
73
|
+
no_such_file_or_directory,
|
74
|
+
no_such_process,
|
75
|
+
not_a_directory,
|
76
|
+
not_a_socket,
|
77
|
+
not_a_stream,
|
78
|
+
not_connected,
|
79
|
+
not_enough_memory,
|
80
|
+
not_supported,
|
81
|
+
operation_canceled,
|
82
|
+
operation_in_progress,
|
83
|
+
operation_not_permitted,
|
84
|
+
operation_not_supported,
|
85
|
+
operation_would_block,
|
86
|
+
owner_dead,
|
87
|
+
permission_denied,
|
88
|
+
protocol_error,
|
89
|
+
protocol_not_supported,
|
90
|
+
read_only_file_system,
|
91
|
+
resource_deadlock_would_occur,
|
92
|
+
resource_unavailable_try_again,
|
93
|
+
result_out_of_range,
|
94
|
+
state_not_recoverable,
|
95
|
+
stream_timeout,
|
96
|
+
text_file_busy,
|
97
|
+
timed_out,
|
98
|
+
too_many_files_open_in_system,
|
99
|
+
too_many_files_open,
|
100
|
+
too_many_links,
|
101
|
+
too_many_symbolic_link_levels,
|
102
|
+
value_too_large,
|
103
|
+
wrong_protocol_type
|
104
|
+
};
|
105
|
+
|
106
|
+
int const n = sizeof( gen ) / sizeof( gen[0] );
|
107
|
+
|
108
|
+
for( int i = 0; i < n; ++i )
|
109
|
+
{
|
110
|
+
if( ev == gen[ i ] ) return true;
|
111
|
+
}
|
112
|
+
|
113
|
+
return false;
|
114
|
+
}
|
115
|
+
|
116
|
+
inline error_condition system_category_default_error_condition_posix( int ev ) BOOST_NOEXCEPT
|
117
|
+
{
|
118
|
+
if( is_generic_value( ev ) )
|
119
|
+
{
|
120
|
+
return error_condition( ev, generic_category() );
|
121
|
+
}
|
122
|
+
else
|
123
|
+
{
|
124
|
+
return error_condition( ev, system_category() );
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
} // namespace detail
|
129
|
+
|
130
|
+
} // namespace system
|
131
|
+
|
132
|
+
} // namespace boost
|
@@ -1,769 +1,956 @@
|
|
1
|
-
|
1
|
+
#ifndef BOOST_SYSTEM_ERROR_CODE_HPP_INCLUDED
|
2
|
+
#define BOOST_SYSTEM_ERROR_CODE_HPP_INCLUDED
|
2
3
|
|
3
4
|
// Copyright Beman Dawes 2006, 2007
|
4
5
|
// Copyright Christoper Kohlhoff 2007
|
5
6
|
// Copyright Peter Dimov 2017, 2018
|
6
|
-
|
7
|
+
//
|
7
8
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
8
9
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
9
|
-
|
10
|
+
//
|
10
11
|
// See library home page at http://www.boost.org/libs/system
|
11
12
|
|
12
|
-
#
|
13
|
-
#
|
14
|
-
|
15
|
-
#include <boost/system/config.hpp>
|
13
|
+
#include <boost/system/api_config.hpp>
|
14
|
+
#include <boost/system/detail/config.hpp>
|
16
15
|
#include <boost/cstdint.hpp>
|
17
|
-
#include <boost/
|
18
|
-
#include <boost/noncopyable.hpp>
|
19
|
-
#include <boost/utility/enable_if.hpp>
|
16
|
+
#include <boost/config.hpp>
|
20
17
|
#include <ostream>
|
21
18
|
#include <string>
|
22
|
-
#include <stdexcept>
|
23
19
|
#include <functional>
|
20
|
+
#include <cstring>
|
24
21
|
|
25
22
|
// TODO: undef these macros if not already defined
|
26
23
|
#include <boost/cerrno.hpp>
|
27
24
|
|
25
|
+
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
26
|
+
# include <system_error>
|
27
|
+
#endif
|
28
|
+
|
28
29
|
#if !defined(BOOST_POSIX_API) && !defined(BOOST_WINDOWS_API)
|
29
30
|
# error BOOST_POSIX_API or BOOST_WINDOWS_API must be defined
|
30
31
|
#endif
|
31
32
|
|
32
|
-
|
33
|
-
|
33
|
+
namespace boost
|
34
|
+
{
|
35
|
+
|
36
|
+
namespace system
|
37
|
+
{
|
38
|
+
|
39
|
+
class error_code; // values defined by the operating system
|
40
|
+
class error_condition; // portable generic values defined below, but ultimately
|
41
|
+
// based on the POSIX standard
|
42
|
+
|
43
|
+
// "Concept" helpers
|
44
|
+
|
45
|
+
template<class T> struct is_error_code_enum
|
46
|
+
{
|
47
|
+
static const bool value = false;
|
48
|
+
};
|
49
|
+
|
50
|
+
template<class T> struct is_error_condition_enum
|
51
|
+
{
|
52
|
+
static const bool value = false;
|
53
|
+
};
|
54
|
+
|
55
|
+
// Generic error_conditions
|
56
|
+
|
57
|
+
namespace errc
|
58
|
+
{
|
59
|
+
|
60
|
+
enum errc_t
|
61
|
+
{
|
62
|
+
success = 0,
|
63
|
+
address_family_not_supported = EAFNOSUPPORT,
|
64
|
+
address_in_use = EADDRINUSE,
|
65
|
+
address_not_available = EADDRNOTAVAIL,
|
66
|
+
already_connected = EISCONN,
|
67
|
+
argument_list_too_long = E2BIG,
|
68
|
+
argument_out_of_domain = EDOM,
|
69
|
+
bad_address = EFAULT,
|
70
|
+
bad_file_descriptor = EBADF,
|
71
|
+
bad_message = EBADMSG,
|
72
|
+
broken_pipe = EPIPE,
|
73
|
+
connection_aborted = ECONNABORTED,
|
74
|
+
connection_already_in_progress = EALREADY,
|
75
|
+
connection_refused = ECONNREFUSED,
|
76
|
+
connection_reset = ECONNRESET,
|
77
|
+
cross_device_link = EXDEV,
|
78
|
+
destination_address_required = EDESTADDRREQ,
|
79
|
+
device_or_resource_busy = EBUSY,
|
80
|
+
directory_not_empty = ENOTEMPTY,
|
81
|
+
executable_format_error = ENOEXEC,
|
82
|
+
file_exists = EEXIST,
|
83
|
+
file_too_large = EFBIG,
|
84
|
+
filename_too_long = ENAMETOOLONG,
|
85
|
+
function_not_supported = ENOSYS,
|
86
|
+
host_unreachable = EHOSTUNREACH,
|
87
|
+
identifier_removed = EIDRM,
|
88
|
+
illegal_byte_sequence = EILSEQ,
|
89
|
+
inappropriate_io_control_operation = ENOTTY,
|
90
|
+
interrupted = EINTR,
|
91
|
+
invalid_argument = EINVAL,
|
92
|
+
invalid_seek = ESPIPE,
|
93
|
+
io_error = EIO,
|
94
|
+
is_a_directory = EISDIR,
|
95
|
+
message_size = EMSGSIZE,
|
96
|
+
network_down = ENETDOWN,
|
97
|
+
network_reset = ENETRESET,
|
98
|
+
network_unreachable = ENETUNREACH,
|
99
|
+
no_buffer_space = ENOBUFS,
|
100
|
+
no_child_process = ECHILD,
|
101
|
+
no_link = ENOLINK,
|
102
|
+
no_lock_available = ENOLCK,
|
103
|
+
no_message_available = ENODATA,
|
104
|
+
no_message = ENOMSG,
|
105
|
+
no_protocol_option = ENOPROTOOPT,
|
106
|
+
no_space_on_device = ENOSPC,
|
107
|
+
no_stream_resources = ENOSR,
|
108
|
+
no_such_device_or_address = ENXIO,
|
109
|
+
no_such_device = ENODEV,
|
110
|
+
no_such_file_or_directory = ENOENT,
|
111
|
+
no_such_process = ESRCH,
|
112
|
+
not_a_directory = ENOTDIR,
|
113
|
+
not_a_socket = ENOTSOCK,
|
114
|
+
not_a_stream = ENOSTR,
|
115
|
+
not_connected = ENOTCONN,
|
116
|
+
not_enough_memory = ENOMEM,
|
117
|
+
not_supported = ENOTSUP,
|
118
|
+
operation_canceled = ECANCELED,
|
119
|
+
operation_in_progress = EINPROGRESS,
|
120
|
+
operation_not_permitted = EPERM,
|
121
|
+
operation_not_supported = EOPNOTSUPP,
|
122
|
+
operation_would_block = EWOULDBLOCK,
|
123
|
+
owner_dead = EOWNERDEAD,
|
124
|
+
permission_denied = EACCES,
|
125
|
+
protocol_error = EPROTO,
|
126
|
+
protocol_not_supported = EPROTONOSUPPORT,
|
127
|
+
read_only_file_system = EROFS,
|
128
|
+
resource_deadlock_would_occur = EDEADLK,
|
129
|
+
resource_unavailable_try_again = EAGAIN,
|
130
|
+
result_out_of_range = ERANGE,
|
131
|
+
state_not_recoverable = ENOTRECOVERABLE,
|
132
|
+
stream_timeout = ETIME,
|
133
|
+
text_file_busy = ETXTBSY,
|
134
|
+
timed_out = ETIMEDOUT,
|
135
|
+
too_many_files_open_in_system = ENFILE,
|
136
|
+
too_many_files_open = EMFILE,
|
137
|
+
too_many_links = EMLINK,
|
138
|
+
too_many_symbolic_link_levels = ELOOP,
|
139
|
+
value_too_large = EOVERFLOW,
|
140
|
+
wrong_protocol_type = EPROTOTYPE
|
141
|
+
};
|
142
|
+
|
143
|
+
} // namespace errc
|
144
|
+
|
145
|
+
#ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
|
146
|
+
|
147
|
+
namespace posix = errc;
|
148
|
+
namespace posix_error = errc;
|
149
|
+
|
34
150
|
#endif
|
35
151
|
|
36
|
-
|
152
|
+
template<> struct is_error_condition_enum<errc::errc_t>
|
153
|
+
{
|
154
|
+
static const bool value = true;
|
155
|
+
};
|
156
|
+
|
157
|
+
// class error_category
|
37
158
|
|
38
|
-
#
|
39
|
-
#
|
159
|
+
#ifdef BOOST_MSVC
|
160
|
+
#pragma warning( push )
|
161
|
+
// 'this' : used in base member initializer list
|
162
|
+
#pragma warning( disable: 4355 )
|
40
163
|
#endif
|
41
164
|
|
42
|
-
|
165
|
+
std::size_t hash_value( error_code const & ec );
|
166
|
+
|
167
|
+
class BOOST_SYMBOL_VISIBLE error_category
|
43
168
|
{
|
44
|
-
|
45
|
-
{
|
46
|
-
|
47
|
-
class error_code; // values defined by the operating system
|
48
|
-
class error_condition; // portable generic values defined below, but ultimately
|
49
|
-
// based on the POSIX standard
|
50
|
-
|
51
|
-
// "Concept" helpers -------------------------------------------------------------//
|
52
|
-
|
53
|
-
template< class T >
|
54
|
-
struct is_error_code_enum { static const bool value = false; };
|
55
|
-
|
56
|
-
template< class T >
|
57
|
-
struct is_error_condition_enum { static const bool value = false; };
|
58
|
-
|
59
|
-
// generic error_conditions ------------------------------------------------------//
|
60
|
-
|
61
|
-
namespace errc
|
62
|
-
{
|
63
|
-
enum errc_t
|
64
|
-
{
|
65
|
-
success = 0,
|
66
|
-
address_family_not_supported = EAFNOSUPPORT,
|
67
|
-
address_in_use = EADDRINUSE,
|
68
|
-
address_not_available = EADDRNOTAVAIL,
|
69
|
-
already_connected = EISCONN,
|
70
|
-
argument_list_too_long = E2BIG,
|
71
|
-
argument_out_of_domain = EDOM,
|
72
|
-
bad_address = EFAULT,
|
73
|
-
bad_file_descriptor = EBADF,
|
74
|
-
bad_message = EBADMSG,
|
75
|
-
broken_pipe = EPIPE,
|
76
|
-
connection_aborted = ECONNABORTED,
|
77
|
-
connection_already_in_progress = EALREADY,
|
78
|
-
connection_refused = ECONNREFUSED,
|
79
|
-
connection_reset = ECONNRESET,
|
80
|
-
cross_device_link = EXDEV,
|
81
|
-
destination_address_required = EDESTADDRREQ,
|
82
|
-
device_or_resource_busy = EBUSY,
|
83
|
-
directory_not_empty = ENOTEMPTY,
|
84
|
-
executable_format_error = ENOEXEC,
|
85
|
-
file_exists = EEXIST,
|
86
|
-
file_too_large = EFBIG,
|
87
|
-
filename_too_long = ENAMETOOLONG,
|
88
|
-
function_not_supported = ENOSYS,
|
89
|
-
host_unreachable = EHOSTUNREACH,
|
90
|
-
identifier_removed = EIDRM,
|
91
|
-
illegal_byte_sequence = EILSEQ,
|
92
|
-
inappropriate_io_control_operation = ENOTTY,
|
93
|
-
interrupted = EINTR,
|
94
|
-
invalid_argument = EINVAL,
|
95
|
-
invalid_seek = ESPIPE,
|
96
|
-
io_error = EIO,
|
97
|
-
is_a_directory = EISDIR,
|
98
|
-
message_size = EMSGSIZE,
|
99
|
-
network_down = ENETDOWN,
|
100
|
-
network_reset = ENETRESET,
|
101
|
-
network_unreachable = ENETUNREACH,
|
102
|
-
no_buffer_space = ENOBUFS,
|
103
|
-
no_child_process = ECHILD,
|
104
|
-
no_link = ENOLINK,
|
105
|
-
no_lock_available = ENOLCK,
|
106
|
-
no_message_available = ENODATA,
|
107
|
-
no_message = ENOMSG,
|
108
|
-
no_protocol_option = ENOPROTOOPT,
|
109
|
-
no_space_on_device = ENOSPC,
|
110
|
-
no_stream_resources = ENOSR,
|
111
|
-
no_such_device_or_address = ENXIO,
|
112
|
-
no_such_device = ENODEV,
|
113
|
-
no_such_file_or_directory = ENOENT,
|
114
|
-
no_such_process = ESRCH,
|
115
|
-
not_a_directory = ENOTDIR,
|
116
|
-
not_a_socket = ENOTSOCK,
|
117
|
-
not_a_stream = ENOSTR,
|
118
|
-
not_connected = ENOTCONN,
|
119
|
-
not_enough_memory = ENOMEM,
|
120
|
-
not_supported = ENOTSUP,
|
121
|
-
operation_canceled = ECANCELED,
|
122
|
-
operation_in_progress = EINPROGRESS,
|
123
|
-
operation_not_permitted = EPERM,
|
124
|
-
operation_not_supported = EOPNOTSUPP,
|
125
|
-
operation_would_block = EWOULDBLOCK,
|
126
|
-
owner_dead = EOWNERDEAD,
|
127
|
-
permission_denied = EACCES,
|
128
|
-
protocol_error = EPROTO,
|
129
|
-
protocol_not_supported = EPROTONOSUPPORT,
|
130
|
-
read_only_file_system = EROFS,
|
131
|
-
resource_deadlock_would_occur = EDEADLK,
|
132
|
-
resource_unavailable_try_again = EAGAIN,
|
133
|
-
result_out_of_range = ERANGE,
|
134
|
-
state_not_recoverable = ENOTRECOVERABLE,
|
135
|
-
stream_timeout = ETIME,
|
136
|
-
text_file_busy = ETXTBSY,
|
137
|
-
timed_out = ETIMEDOUT,
|
138
|
-
too_many_files_open_in_system = ENFILE,
|
139
|
-
too_many_files_open = EMFILE,
|
140
|
-
too_many_links = EMLINK,
|
141
|
-
too_many_symbolic_link_levels = ELOOP,
|
142
|
-
value_too_large = EOVERFLOW,
|
143
|
-
wrong_protocol_type = EPROTOTYPE
|
144
|
-
};
|
145
|
-
|
146
|
-
} // namespace errc
|
147
|
-
|
148
|
-
# ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
|
149
|
-
namespace posix = errc;
|
150
|
-
namespace posix_error = errc;
|
151
|
-
# endif
|
169
|
+
private:
|
152
170
|
|
153
|
-
|
154
|
-
{ static const bool value = true; };
|
171
|
+
friend std::size_t hash_value( error_code const & ec );
|
155
172
|
|
173
|
+
#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
174
|
+
public:
|
156
175
|
|
157
|
-
|
176
|
+
error_category( error_category const & ) = delete;
|
177
|
+
error_category& operator=( error_category const & ) = delete;
|
158
178
|
|
159
|
-
|
179
|
+
#else
|
180
|
+
private:
|
160
181
|
|
182
|
+
error_category( error_category const & );
|
183
|
+
error_category& operator=( error_category const & );
|
161
184
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
// * Code calling an operating system API can create an error_code with
|
166
|
-
// a single category (system_category), even for POSIX-like operating
|
167
|
-
// systems that return some POSIX errno values and some native errno
|
168
|
-
// values. This code should not have to pay the cost of distinguishing
|
169
|
-
// between categories, since it is not yet known if that is needed.
|
170
|
-
//
|
171
|
-
// * Users wishing to write system-specific code should be given enums for
|
172
|
-
// at least the common error cases.
|
173
|
-
//
|
174
|
-
// * System specific code should fail at compile time if moved to another
|
175
|
-
// operating system.
|
185
|
+
#endif
|
186
|
+
|
187
|
+
private:
|
176
188
|
|
177
|
-
|
178
|
-
// with names reflecting the operating system. For example,
|
179
|
-
//
|
180
|
-
// <boost/system/cygwin_error.hpp>
|
181
|
-
// <boost/system/linux_error.hpp>
|
182
|
-
// <boost/system/windows_error.hpp>
|
183
|
-
//
|
184
|
-
// These headers are effectively empty for compiles on operating systems
|
185
|
-
// where they are not applicable.
|
189
|
+
boost::ulong_long_type id_;
|
186
190
|
|
187
|
-
|
191
|
+
protected:
|
188
192
|
|
189
|
-
|
193
|
+
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)
|
190
194
|
|
191
|
-
|
195
|
+
~error_category() = default;
|
192
196
|
|
193
|
-
#ifdef BOOST_ERROR_CODE_HEADER_ONLY
|
194
|
-
inline const error_category & system_category() BOOST_SYSTEM_NOEXCEPT;
|
195
|
-
inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT;
|
196
197
|
#else
|
197
|
-
BOOST_SYSTEM_DECL const error_category & system_category() BOOST_SYSTEM_NOEXCEPT;
|
198
|
-
BOOST_SYSTEM_DECL const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT;
|
199
|
-
#endif
|
200
|
-
// deprecated synonyms ------------------------------------------------------------//
|
201
198
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
static const error_category & errno_ecat BOOST_ATTRIBUTE_UNUSED
|
209
|
-
= generic_category();
|
210
|
-
static const error_category & native_ecat BOOST_ATTRIBUTE_UNUSED
|
211
|
-
= system_category();
|
212
|
-
#endif
|
199
|
+
// We'd like to make the destructor protected, to make code that deletes
|
200
|
+
// an error_category* not compile; unfortunately, doing the below makes
|
201
|
+
// the destructor user-provided and hence breaks use after main, as the
|
202
|
+
// categories may get destroyed before code that uses them
|
203
|
+
|
204
|
+
// ~error_category() {}
|
213
205
|
|
214
|
-
#ifdef BOOST_MSVC
|
215
|
-
#pragma warning(push)
|
216
|
-
// 'this' : used in base member initializer list
|
217
|
-
#pragma warning(disable: 4355)
|
218
206
|
#endif
|
219
207
|
|
220
|
-
|
208
|
+
BOOST_SYSTEM_CONSTEXPR error_category() BOOST_NOEXCEPT: id_( 0 )
|
209
|
+
{
|
210
|
+
}
|
221
211
|
|
222
|
-
|
212
|
+
explicit BOOST_SYSTEM_CONSTEXPR error_category( boost::ulong_long_type id ) BOOST_NOEXCEPT: id_( id )
|
223
213
|
{
|
224
|
-
|
214
|
+
}
|
215
|
+
|
216
|
+
public:
|
217
|
+
|
218
|
+
virtual const char * name() const BOOST_NOEXCEPT = 0;
|
225
219
|
|
226
|
-
|
220
|
+
virtual error_condition default_error_condition( int ev ) const BOOST_NOEXCEPT;
|
221
|
+
virtual bool equivalent( int code, const error_condition & condition ) const BOOST_NOEXCEPT;
|
222
|
+
virtual bool equivalent( const error_code & code, int condition ) const BOOST_NOEXCEPT;
|
227
223
|
|
228
|
-
|
229
|
-
|
230
|
-
private:
|
224
|
+
virtual std::string message( int ev ) const = 0;
|
225
|
+
virtual char const * message( int ev, char * buffer, std::size_t len ) const BOOST_NOEXCEPT;
|
231
226
|
|
232
|
-
|
227
|
+
virtual bool failed( int ev ) const BOOST_NOEXCEPT;
|
233
228
|
|
234
|
-
|
229
|
+
BOOST_SYSTEM_CONSTEXPR bool operator==( const error_category & rhs ) const BOOST_NOEXCEPT
|
230
|
+
{
|
231
|
+
return rhs.id_ == 0? this == &rhs: id_ == rhs.id_;
|
232
|
+
}
|
233
|
+
|
234
|
+
BOOST_SYSTEM_CONSTEXPR bool operator!=( const error_category & rhs ) const BOOST_NOEXCEPT
|
235
|
+
{
|
236
|
+
return !( *this == rhs );
|
237
|
+
}
|
235
238
|
|
236
|
-
|
239
|
+
BOOST_SYSTEM_CONSTEXPR bool operator<( const error_category & rhs ) const BOOST_NOEXCEPT
|
240
|
+
{
|
241
|
+
if( id_ < rhs.id_ )
|
237
242
|
{
|
243
|
+
return true;
|
238
244
|
}
|
239
245
|
|
240
|
-
|
246
|
+
if( id_ > rhs.id_ )
|
241
247
|
{
|
242
|
-
|
248
|
+
return false;
|
243
249
|
}
|
244
250
|
|
245
|
-
|
251
|
+
if( rhs.id_ != 0 )
|
246
252
|
{
|
247
|
-
|
253
|
+
return false; // equal
|
248
254
|
}
|
249
255
|
|
250
|
-
|
251
|
-
|
252
|
-
virtual bool equivalent( int code, const std::error_condition & condition ) const
|
253
|
-
BOOST_NOEXCEPT;
|
254
|
-
virtual bool equivalent( const std::error_code & code, int condition ) const
|
255
|
-
BOOST_NOEXCEPT;
|
256
|
-
};
|
256
|
+
return std::less<error_category const *>()( this, &rhs );
|
257
|
+
}
|
257
258
|
|
258
|
-
|
259
|
+
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
259
260
|
|
260
|
-
|
261
|
+
operator std::error_category const & () const;
|
261
262
|
|
262
|
-
|
263
|
+
#endif
|
264
|
+
};
|
263
265
|
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
// there are two std::generic categories in a program, which leads
|
268
|
-
// to error codes/conditions mysteriously not being equal to themselves
|
269
|
-
return std_cat_;
|
270
|
-
}
|
266
|
+
#ifdef BOOST_MSVC
|
267
|
+
#pragma warning( pop )
|
268
|
+
#endif
|
271
269
|
|
272
|
-
|
270
|
+
// predefined error categories
|
273
271
|
|
274
|
-
|
275
|
-
|
272
|
+
namespace detail
|
273
|
+
{
|
276
274
|
|
277
|
-
|
275
|
+
class BOOST_SYMBOL_VISIBLE generic_error_category: public error_category
|
276
|
+
{
|
277
|
+
public:
|
278
278
|
|
279
|
-
|
280
|
-
|
281
|
-
|
279
|
+
// clang++ 3.8 and below: initialization of const object
|
280
|
+
// requires a user-provided default constructor
|
281
|
+
BOOST_SYSTEM_CONSTEXPR generic_error_category() BOOST_NOEXCEPT:
|
282
|
+
error_category( ( boost::ulong_long_type( 0xB2AB117A ) << 32 ) + 0x257EDF0D )
|
283
|
+
{
|
284
|
+
}
|
282
285
|
|
283
|
-
|
286
|
+
const char * name() const BOOST_NOEXCEPT
|
287
|
+
{
|
288
|
+
return "generic";
|
289
|
+
}
|
284
290
|
|
285
|
-
|
291
|
+
std::string message( int ev ) const;
|
292
|
+
char const * message( int ev, char * buffer, std::size_t len ) const BOOST_NOEXCEPT;
|
293
|
+
};
|
286
294
|
|
287
|
-
|
288
|
-
|
289
|
-
|
295
|
+
class BOOST_SYMBOL_VISIBLE system_error_category: public error_category
|
296
|
+
{
|
297
|
+
public:
|
290
298
|
|
291
|
-
|
299
|
+
BOOST_SYSTEM_CONSTEXPR system_error_category() BOOST_NOEXCEPT:
|
300
|
+
error_category( ( boost::ulong_long_type( 0x8FAFD21E ) << 32 ) + 0x25C5E09B )
|
301
|
+
{
|
302
|
+
}
|
292
303
|
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
304
|
+
const char * name() const BOOST_NOEXCEPT
|
305
|
+
{
|
306
|
+
return "system";
|
307
|
+
}
|
297
308
|
|
298
|
-
|
299
|
-
// which can be different between 03 and 11, and (2) on mingw, there
|
300
|
-
// are actually two `message` functions, not one, so it doesn't work
|
301
|
-
// even if we do
|
309
|
+
error_condition default_error_condition( int ev ) const BOOST_NOEXCEPT;
|
302
310
|
|
303
|
-
|
311
|
+
std::string message( int ev ) const;
|
312
|
+
char const * message( int ev, char * buffer, std::size_t len ) const BOOST_NOEXCEPT;
|
313
|
+
};
|
304
314
|
|
305
|
-
|
306
|
-
// better than the alternative of having the class layout change
|
307
|
-
};
|
315
|
+
} // namespace detail
|
308
316
|
|
309
|
-
|
317
|
+
// generic_category(), system_category()
|
310
318
|
|
311
|
-
|
319
|
+
#if defined(BOOST_SYSTEM_HAS_CONSTEXPR)
|
312
320
|
|
313
|
-
|
321
|
+
namespace detail
|
322
|
+
{
|
314
323
|
|
315
|
-
|
324
|
+
template<class T> struct cat_holder
|
325
|
+
{
|
326
|
+
BOOST_SYSTEM_REQUIRE_CONST_INIT static constexpr system_error_category system_category_instance{};
|
327
|
+
BOOST_SYSTEM_REQUIRE_CONST_INIT static constexpr generic_error_category generic_category_instance{};
|
328
|
+
};
|
316
329
|
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
virtual const char * name() const BOOST_SYSTEM_NOEXCEPT = 0;
|
321
|
-
virtual std::string message( int ev ) const = 0;
|
322
|
-
inline virtual error_condition default_error_condition( int ev ) const
|
323
|
-
BOOST_SYSTEM_NOEXCEPT;
|
324
|
-
inline virtual bool equivalent( int code,
|
325
|
-
const error_condition & condition ) const
|
326
|
-
BOOST_SYSTEM_NOEXCEPT;
|
327
|
-
inline virtual bool equivalent( const error_code & code,
|
328
|
-
int condition ) const BOOST_SYSTEM_NOEXCEPT;
|
329
|
-
|
330
|
-
bool operator==(const error_category & rhs) const BOOST_SYSTEM_NOEXCEPT
|
331
|
-
{ return this == &rhs; }
|
332
|
-
bool operator!=(const error_category & rhs) const BOOST_SYSTEM_NOEXCEPT
|
333
|
-
{ return this != &rhs; }
|
334
|
-
bool operator<( const error_category & rhs ) const BOOST_SYSTEM_NOEXCEPT
|
335
|
-
{ return std::less<const error_category*>()( this, &rhs ); }
|
336
|
-
};
|
330
|
+
template<class T> BOOST_SYSTEM_REQUIRE_CONST_INIT constexpr system_error_category cat_holder<T>::system_category_instance;
|
331
|
+
template<class T> BOOST_SYSTEM_REQUIRE_CONST_INIT constexpr generic_error_category cat_holder<T>::generic_category_instance;
|
337
332
|
|
338
|
-
|
339
|
-
#pragma warning(pop)
|
340
|
-
#endif
|
333
|
+
} // namespace detail
|
341
334
|
|
342
|
-
|
335
|
+
constexpr error_category const & system_category() BOOST_NOEXCEPT
|
336
|
+
{
|
337
|
+
return detail::cat_holder<void>::system_category_instance;
|
338
|
+
}
|
343
339
|
|
344
|
-
|
340
|
+
constexpr error_category const & generic_category() BOOST_NOEXCEPT
|
341
|
+
{
|
342
|
+
return detail::cat_holder<void>::generic_category_instance;
|
343
|
+
}
|
345
344
|
|
346
|
-
|
347
|
-
{
|
348
|
-
public:
|
345
|
+
#else // #if defined(BOOST_SYSTEM_HAS_CONSTEXPR)
|
349
346
|
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
347
|
+
inline error_category const & system_category() BOOST_NOEXCEPT
|
348
|
+
{
|
349
|
+
static const detail::system_error_category system_category_instance;
|
350
|
+
return system_category_instance;
|
351
|
+
}
|
354
352
|
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
*this = make_error_condition(e);
|
361
|
-
}
|
353
|
+
inline error_category const & generic_category() BOOST_NOEXCEPT
|
354
|
+
{
|
355
|
+
static const detail::generic_error_category generic_category_instance;
|
356
|
+
return generic_category_instance;
|
357
|
+
}
|
362
358
|
|
363
|
-
|
359
|
+
#endif // #if defined(BOOST_SYSTEM_HAS_CONSTEXPR)
|
364
360
|
|
365
|
-
|
366
|
-
{
|
367
|
-
m_val = val;
|
368
|
-
m_cat = &cat;
|
369
|
-
}
|
361
|
+
// deprecated synonyms
|
370
362
|
|
371
|
-
|
372
|
-
typename boost::enable_if<is_error_condition_enum<ErrorConditionEnum>,
|
373
|
-
error_condition>::type &
|
374
|
-
operator=( ErrorConditionEnum val ) BOOST_SYSTEM_NOEXCEPT
|
375
|
-
{
|
376
|
-
*this = make_error_condition(val);
|
377
|
-
return *this;
|
378
|
-
}
|
363
|
+
#ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
|
379
364
|
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
365
|
+
inline const error_category & get_system_category() { return system_category(); }
|
366
|
+
inline const error_category & get_generic_category() { return generic_category(); }
|
367
|
+
inline const error_category & get_posix_category() { return generic_category(); }
|
368
|
+
static const error_category & posix_category BOOST_ATTRIBUTE_UNUSED = generic_category();
|
369
|
+
static const error_category & errno_ecat BOOST_ATTRIBUTE_UNUSED = generic_category();
|
370
|
+
static const error_category & native_ecat BOOST_ATTRIBUTE_UNUSED = system_category();
|
385
371
|
|
386
|
-
|
387
|
-
int value() const BOOST_SYSTEM_NOEXCEPT { return m_val; }
|
388
|
-
const error_category & category() const BOOST_SYSTEM_NOEXCEPT { return *m_cat; }
|
389
|
-
std::string message() const { return m_cat->message(value()); }
|
372
|
+
#endif
|
390
373
|
|
391
|
-
|
374
|
+
// enable_if
|
392
375
|
|
393
|
-
|
394
|
-
|
395
|
-
return m_val != 0;
|
396
|
-
}
|
376
|
+
namespace detail
|
377
|
+
{
|
397
378
|
|
398
|
-
|
379
|
+
template<bool C, class T = void> struct enable_if
|
380
|
+
{
|
381
|
+
typedef T type;
|
382
|
+
};
|
399
383
|
|
400
|
-
|
401
|
-
|
384
|
+
template<class T> struct enable_if<false, T>
|
385
|
+
{
|
386
|
+
};
|
402
387
|
|
403
|
-
|
404
|
-
{
|
405
|
-
return m_val == 0 ? 0 : unspecified_bool_true;
|
406
|
-
}
|
388
|
+
// failed_impl
|
407
389
|
|
408
|
-
|
409
|
-
{
|
410
|
-
return m_val == 0;
|
411
|
-
}
|
390
|
+
#if !defined(BOOST_SYSTEM_HAS_CONSTEXPR)
|
412
391
|
|
413
|
-
|
392
|
+
inline bool failed_impl( int ev, error_category const & cat )
|
393
|
+
{
|
394
|
+
return cat.failed( ev );
|
395
|
+
}
|
414
396
|
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
return
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
{
|
429
|
-
return lhs.m_cat < rhs.m_cat
|
430
|
-
|| (lhs.m_cat == rhs.m_cat && lhs.m_val < rhs.m_val);
|
431
|
-
}
|
432
|
-
|
433
|
-
#ifndef BOOST_NO_CXX11_HDR_SYSTEM_ERROR
|
434
|
-
|
435
|
-
operator std::error_condition () const BOOST_SYSTEM_NOEXCEPT
|
436
|
-
{
|
437
|
-
return std::error_condition( value(), category() );
|
438
|
-
}
|
397
|
+
#else
|
398
|
+
|
399
|
+
BOOST_SYSTEM_CONSTEXPR inline bool failed_impl( int ev, error_category const & cat )
|
400
|
+
{
|
401
|
+
if( cat == system_category() || cat == generic_category() )
|
402
|
+
{
|
403
|
+
return ev != 0;
|
404
|
+
}
|
405
|
+
else
|
406
|
+
{
|
407
|
+
return cat.failed( ev );
|
408
|
+
}
|
409
|
+
}
|
439
410
|
|
440
411
|
#endif
|
441
412
|
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
413
|
+
} // namespace detail
|
414
|
+
|
415
|
+
// class error_condition
|
416
|
+
|
417
|
+
// error_conditions are portable, error_codes are system or library specific
|
418
|
+
|
419
|
+
class error_condition
|
420
|
+
{
|
421
|
+
private:
|
422
|
+
|
423
|
+
int val_;
|
424
|
+
bool failed_;
|
425
|
+
error_category const * cat_;
|
426
|
+
|
427
|
+
public:
|
428
|
+
|
429
|
+
// constructors:
|
430
|
+
|
431
|
+
BOOST_SYSTEM_CONSTEXPR error_condition() BOOST_NOEXCEPT:
|
432
|
+
val_( 0 ), failed_( false ), cat_( &generic_category() )
|
433
|
+
{
|
434
|
+
}
|
435
|
+
|
436
|
+
BOOST_SYSTEM_CONSTEXPR error_condition( int val, const error_category & cat ) BOOST_NOEXCEPT:
|
437
|
+
val_( val ), failed_( detail::failed_impl( val, cat ) ), cat_( &cat )
|
438
|
+
{
|
439
|
+
}
|
440
|
+
|
441
|
+
template<class ErrorConditionEnum> BOOST_SYSTEM_CONSTEXPR error_condition( ErrorConditionEnum e,
|
442
|
+
typename detail::enable_if<is_error_condition_enum<ErrorConditionEnum>::value>::type* = 0) BOOST_NOEXCEPT
|
443
|
+
{
|
444
|
+
*this = make_error_condition( e );
|
445
|
+
}
|
446
|
+
|
447
|
+
// modifiers:
|
448
|
+
|
449
|
+
BOOST_SYSTEM_CONSTEXPR void assign( int val, const error_category & cat ) BOOST_NOEXCEPT
|
450
|
+
{
|
451
|
+
val_ = val;
|
452
|
+
failed_ = detail::failed_impl( val, cat );
|
453
|
+
cat_ = &cat;
|
454
|
+
}
|
455
|
+
|
456
|
+
template<typename ErrorConditionEnum>
|
457
|
+
BOOST_SYSTEM_CONSTEXPR typename detail::enable_if<is_error_condition_enum<ErrorConditionEnum>::value, error_condition>::type &
|
458
|
+
operator=( ErrorConditionEnum val ) BOOST_NOEXCEPT
|
459
|
+
{
|
460
|
+
*this = make_error_condition( val );
|
485
461
|
return *this;
|
486
|
-
|
462
|
+
}
|
487
463
|
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
464
|
+
BOOST_SYSTEM_CONSTEXPR void clear() BOOST_NOEXCEPT
|
465
|
+
{
|
466
|
+
val_ = 0;
|
467
|
+
failed_ = false;
|
468
|
+
cat_ = &generic_category();
|
469
|
+
}
|
493
470
|
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
471
|
+
// observers:
|
472
|
+
|
473
|
+
BOOST_SYSTEM_CONSTEXPR int value() const BOOST_NOEXCEPT
|
474
|
+
{
|
475
|
+
return val_;
|
476
|
+
}
|
477
|
+
|
478
|
+
BOOST_SYSTEM_CONSTEXPR const error_category & category() const BOOST_NOEXCEPT
|
479
|
+
{
|
480
|
+
return *cat_;
|
481
|
+
}
|
482
|
+
|
483
|
+
std::string message() const
|
484
|
+
{
|
485
|
+
return cat_->message( value() );
|
486
|
+
}
|
487
|
+
|
488
|
+
char const * message( char * buffer, std::size_t len ) const BOOST_NOEXCEPT
|
489
|
+
{
|
490
|
+
return cat_->message( value(), buffer, len );
|
491
|
+
}
|
492
|
+
|
493
|
+
BOOST_SYSTEM_CONSTEXPR bool failed() const BOOST_NOEXCEPT
|
494
|
+
{
|
495
|
+
return failed_;
|
496
|
+
}
|
500
497
|
|
501
498
|
#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
|
502
499
|
|
503
|
-
|
504
|
-
|
505
|
-
return
|
506
|
-
|
500
|
+
BOOST_SYSTEM_CONSTEXPR explicit operator bool() const BOOST_NOEXCEPT // true if error
|
501
|
+
{
|
502
|
+
return failed_;
|
503
|
+
}
|
507
504
|
|
508
505
|
#else
|
509
506
|
|
510
|
-
|
511
|
-
|
507
|
+
typedef void (*unspecified_bool_type)();
|
508
|
+
static void unspecified_bool_true() {}
|
512
509
|
|
513
|
-
|
514
|
-
|
515
|
-
return
|
516
|
-
|
510
|
+
BOOST_SYSTEM_CONSTEXPR operator unspecified_bool_type() const BOOST_NOEXCEPT // true if error
|
511
|
+
{
|
512
|
+
return failed_? unspecified_bool_true: 0;
|
513
|
+
}
|
517
514
|
|
518
|
-
|
519
|
-
|
520
|
-
return
|
521
|
-
|
515
|
+
BOOST_SYSTEM_CONSTEXPR bool operator!() const BOOST_NOEXCEPT // true if no error
|
516
|
+
{
|
517
|
+
return !failed_;
|
518
|
+
}
|
522
519
|
|
523
520
|
#endif
|
524
521
|
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
return lhs.
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
operator std::error_code () const BOOST_SYSTEM_NOEXCEPT
|
546
|
-
{
|
547
|
-
return std::error_code( value(), category() );
|
548
|
-
}
|
522
|
+
// relationals:
|
523
|
+
// the more symmetrical non-member syntax allows enum
|
524
|
+
// conversions work for both rhs and lhs.
|
525
|
+
|
526
|
+
BOOST_SYSTEM_CONSTEXPR inline friend bool operator==( const error_condition & lhs, const error_condition & rhs ) BOOST_NOEXCEPT
|
527
|
+
{
|
528
|
+
return lhs.val_ == rhs.val_ && *lhs.cat_ == *rhs.cat_;
|
529
|
+
}
|
530
|
+
|
531
|
+
BOOST_SYSTEM_CONSTEXPR inline friend bool operator<( const error_condition & lhs, const error_condition & rhs ) BOOST_NOEXCEPT
|
532
|
+
{
|
533
|
+
return *lhs.cat_ < *rhs.cat_ || ( *lhs.cat_ == *rhs.cat_ && lhs.val_ < rhs.val_ );
|
534
|
+
}
|
535
|
+
|
536
|
+
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
537
|
+
|
538
|
+
operator std::error_condition () const
|
539
|
+
{
|
540
|
+
return std::error_condition( value(), category() );
|
541
|
+
}
|
549
542
|
|
550
543
|
#endif
|
544
|
+
};
|
551
545
|
|
552
|
-
|
553
|
-
int m_val;
|
554
|
-
const error_category * m_cat;
|
546
|
+
// class error_code
|
555
547
|
|
556
|
-
|
548
|
+
// We want error_code to be a value type that can be copied without slicing
|
549
|
+
// and without requiring heap allocation, but we also want it to have
|
550
|
+
// polymorphic behavior based on the error category. This is achieved by
|
551
|
+
// abstract base class error_category supplying the polymorphic behavior,
|
552
|
+
// and error_code containing a pointer to an object of a type derived
|
553
|
+
// from error_category.
|
557
554
|
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
555
|
+
class error_code
|
556
|
+
{
|
557
|
+
private:
|
558
|
+
|
559
|
+
int val_;
|
560
|
+
bool failed_;
|
561
|
+
const error_category * cat_;
|
562
|
+
|
563
|
+
public:
|
562
564
|
|
563
|
-
//
|
564
|
-
// existing code is a bit of a problem. The workaround is to place the
|
565
|
-
// "throws" function in namespace boost rather than namespace boost::system.
|
565
|
+
// constructors:
|
566
566
|
|
567
|
-
|
568
|
-
|
569
|
-
namespace detail
|
570
|
-
{
|
571
|
-
// Misuse of the error_code object is turned into a noisy failure by
|
572
|
-
// poisoning the reference. This particular implementation doesn't
|
573
|
-
// produce warnings or errors from popular compilers, is very efficient
|
574
|
-
// (as determined by inspecting generated code), and does not suffer
|
575
|
-
// from order of initialization problems. In practice, it also seems
|
576
|
-
// cause user function error handling implementation errors to be detected
|
577
|
-
// very early in the development cycle.
|
578
|
-
inline system::error_code* throws()
|
567
|
+
BOOST_SYSTEM_CONSTEXPR error_code() BOOST_NOEXCEPT:
|
568
|
+
val_( 0 ), failed_( false ), cat_( &system_category() )
|
579
569
|
{
|
580
|
-
// See github.com/boostorg/system/pull/12 by visigoth for why the return
|
581
|
-
// is poisoned with nonzero rather than (0). A test, test_throws_usage(),
|
582
|
-
// has been added to error_code_test.cpp, and as visigoth mentioned it
|
583
|
-
// fails on clang for release builds with a return of 0 but works fine
|
584
|
-
// with (1).
|
585
|
-
// Since the undefined behavior sanitizer (-fsanitize=undefined) does not
|
586
|
-
// allow a reference to be formed to the unaligned address of (1), we use
|
587
|
-
// (8) instead.
|
588
|
-
return reinterpret_cast<system::error_code*>(8);
|
589
570
|
}
|
590
|
-
}
|
591
571
|
|
592
|
-
|
593
|
-
|
572
|
+
BOOST_SYSTEM_CONSTEXPR error_code( int val, const error_category & cat ) BOOST_NOEXCEPT:
|
573
|
+
val_( val ), failed_( detail::failed_impl( val, cat ) ), cat_( &cat )
|
574
|
+
{
|
575
|
+
}
|
576
|
+
|
577
|
+
template<class ErrorCodeEnum> BOOST_SYSTEM_CONSTEXPR error_code( ErrorCodeEnum e,
|
578
|
+
typename detail::enable_if<is_error_code_enum<ErrorCodeEnum>::value>::type* = 0 ) BOOST_NOEXCEPT
|
579
|
+
{
|
580
|
+
*this = make_error_code( e );
|
581
|
+
}
|
594
582
|
|
595
|
-
|
596
|
-
{
|
597
|
-
// non-member functions ------------------------------------------------//
|
583
|
+
// modifiers:
|
598
584
|
|
599
|
-
|
600
|
-
const error_code & rhs ) BOOST_SYSTEM_NOEXCEPT
|
585
|
+
BOOST_SYSTEM_CONSTEXPR void assign( int val, const error_category & cat ) BOOST_NOEXCEPT
|
601
586
|
{
|
602
|
-
|
587
|
+
val_ = val;
|
588
|
+
failed_ = detail::failed_impl( val, cat );
|
589
|
+
cat_ = &cat;
|
590
|
+
}
|
591
|
+
|
592
|
+
template<typename ErrorCodeEnum>
|
593
|
+
BOOST_SYSTEM_CONSTEXPR typename detail::enable_if<is_error_code_enum<ErrorCodeEnum>::value, error_code>::type &
|
594
|
+
operator=( ErrorCodeEnum val ) BOOST_NOEXCEPT
|
595
|
+
{
|
596
|
+
*this = make_error_code( val );
|
597
|
+
return *this;
|
603
598
|
}
|
604
599
|
|
605
|
-
|
606
|
-
const error_condition & rhs ) BOOST_SYSTEM_NOEXCEPT
|
600
|
+
BOOST_SYSTEM_CONSTEXPR void clear() BOOST_NOEXCEPT
|
607
601
|
{
|
608
|
-
|
602
|
+
val_ = 0;
|
603
|
+
failed_ = false;
|
604
|
+
cat_ = &system_category();
|
609
605
|
}
|
610
606
|
|
611
|
-
|
612
|
-
|
607
|
+
// observers:
|
608
|
+
|
609
|
+
BOOST_SYSTEM_CONSTEXPR int value() const BOOST_NOEXCEPT
|
613
610
|
{
|
614
|
-
|
615
|
-
|| condition.category().equivalent( code, condition.value() );
|
611
|
+
return val_;
|
616
612
|
}
|
617
613
|
|
618
|
-
|
619
|
-
const error_condition & rhs ) BOOST_SYSTEM_NOEXCEPT
|
614
|
+
BOOST_SYSTEM_CONSTEXPR const error_category & category() const BOOST_NOEXCEPT
|
620
615
|
{
|
621
|
-
|
616
|
+
return *cat_;
|
622
617
|
}
|
623
618
|
|
624
|
-
|
625
|
-
const error_code & code ) BOOST_SYSTEM_NOEXCEPT
|
619
|
+
error_condition default_error_condition() const BOOST_NOEXCEPT
|
626
620
|
{
|
627
|
-
|
628
|
-
|| code.category().equivalent( code.value(), condition );
|
621
|
+
return cat_->default_error_condition( value() );
|
629
622
|
}
|
630
623
|
|
631
|
-
|
632
|
-
const error_code & rhs ) BOOST_SYSTEM_NOEXCEPT
|
624
|
+
std::string message() const
|
633
625
|
{
|
634
|
-
|
626
|
+
return cat_->message( value() );
|
635
627
|
}
|
636
628
|
|
637
|
-
|
629
|
+
char const * message( char * buffer, std::size_t len ) const BOOST_NOEXCEPT
|
630
|
+
{
|
631
|
+
return cat_->message( value(), buffer, len );
|
632
|
+
}
|
638
633
|
|
639
|
-
|
640
|
-
inline std::basic_ostream<charT,traits>&
|
641
|
-
operator<< (std::basic_ostream<charT,traits>& os, error_code ec)
|
634
|
+
BOOST_SYSTEM_CONSTEXPR bool failed() const BOOST_NOEXCEPT
|
642
635
|
{
|
643
|
-
|
644
|
-
return os;
|
636
|
+
return failed_;
|
645
637
|
}
|
646
638
|
|
647
|
-
|
639
|
+
#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
|
640
|
+
|
641
|
+
BOOST_SYSTEM_CONSTEXPR explicit operator bool() const BOOST_NOEXCEPT // true if error
|
648
642
|
{
|
649
|
-
|
650
|
-
+ reinterpret_cast<std::size_t>(&ec.category());
|
643
|
+
return failed_;
|
651
644
|
}
|
652
645
|
|
653
|
-
|
646
|
+
#else
|
647
|
+
|
648
|
+
typedef void (*unspecified_bool_type)();
|
649
|
+
static void unspecified_bool_true() {}
|
654
650
|
|
655
|
-
|
651
|
+
BOOST_SYSTEM_CONSTEXPR operator unspecified_bool_type() const BOOST_NOEXCEPT // true if error
|
656
652
|
{
|
657
|
-
|
658
|
-
|
659
|
-
{ return error_code( e, generic_category() ); }
|
653
|
+
return failed_? unspecified_bool_true: 0;
|
654
|
+
}
|
660
655
|
|
661
|
-
|
662
|
-
|
663
|
-
|
656
|
+
BOOST_SYSTEM_CONSTEXPR bool operator!() const BOOST_NOEXCEPT // true if no error
|
657
|
+
{
|
658
|
+
return !failed_;
|
664
659
|
}
|
665
660
|
|
666
|
-
|
661
|
+
#endif
|
662
|
+
|
663
|
+
// relationals:
|
667
664
|
|
668
|
-
|
669
|
-
|
665
|
+
// the more symmetrical non-member syntax allows enum
|
666
|
+
// conversions work for both rhs and lhs.
|
667
|
+
|
668
|
+
BOOST_SYSTEM_CONSTEXPR inline friend bool operator==( const error_code & lhs, const error_code & rhs ) BOOST_NOEXCEPT
|
670
669
|
{
|
671
|
-
|
670
|
+
return lhs.val_ == rhs.val_ && *lhs.cat_ == *rhs.cat_;
|
672
671
|
}
|
673
672
|
|
674
|
-
bool
|
675
|
-
const error_condition & condition ) const BOOST_SYSTEM_NOEXCEPT
|
673
|
+
BOOST_SYSTEM_CONSTEXPR inline friend bool operator<( const error_code & lhs, const error_code & rhs ) BOOST_NOEXCEPT
|
676
674
|
{
|
677
|
-
|
675
|
+
return *lhs.cat_ < *rhs.cat_ || ( *lhs.cat_ == *rhs.cat_ && lhs.val_ < rhs.val_ );
|
678
676
|
}
|
679
677
|
|
680
|
-
|
681
|
-
|
678
|
+
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
679
|
+
|
680
|
+
operator std::error_code () const
|
682
681
|
{
|
683
|
-
|
682
|
+
return std::error_code( value(), category() );
|
684
683
|
}
|
685
684
|
|
686
|
-
#
|
685
|
+
#endif
|
686
|
+
};
|
687
|
+
|
688
|
+
} // namespace system
|
689
|
+
|
690
|
+
// boost::throws()
|
691
|
+
|
692
|
+
namespace detail
|
693
|
+
{
|
694
|
+
|
695
|
+
// Misuse of the error_code object is turned into a noisy failure by
|
696
|
+
// poisoning the reference. This particular implementation doesn't
|
697
|
+
// produce warnings or errors from popular compilers, is very efficient
|
698
|
+
// (as determined by inspecting generated code), and does not suffer
|
699
|
+
// from order of initialization problems. In practice, it also seems
|
700
|
+
// cause user function error handling implementation errors to be detected
|
701
|
+
// very early in the development cycle.
|
702
|
+
|
703
|
+
inline system::error_code* throws()
|
704
|
+
{
|
705
|
+
// See github.com/boostorg/system/pull/12 by visigoth for why the return
|
706
|
+
// is poisoned with nonzero rather than (0). A test, test_throws_usage(),
|
707
|
+
// has been added to error_code_test.cpp, and as visigoth mentioned it
|
708
|
+
// fails on clang for release builds with a return of 0 but works fine
|
709
|
+
// with (1).
|
710
|
+
// Since the undefined behavior sanitizer (-fsanitize=undefined) does not
|
711
|
+
// allow a reference to be formed to the unaligned address of (1), we use
|
712
|
+
// (8) instead.
|
713
|
+
|
714
|
+
return reinterpret_cast<system::error_code*>(8);
|
715
|
+
}
|
716
|
+
|
717
|
+
} // namespace detail
|
718
|
+
|
719
|
+
inline system::error_code& throws()
|
720
|
+
{
|
721
|
+
return *detail::throws();
|
722
|
+
}
|
723
|
+
|
724
|
+
// non-member functions of error_code and error_condition
|
725
|
+
|
726
|
+
namespace system
|
727
|
+
{
|
728
|
+
|
729
|
+
BOOST_SYSTEM_CONSTEXPR inline bool operator!=( const error_code & lhs, const error_code & rhs ) BOOST_NOEXCEPT
|
730
|
+
{
|
731
|
+
return !( lhs == rhs );
|
732
|
+
}
|
733
|
+
|
734
|
+
BOOST_SYSTEM_CONSTEXPR inline bool operator!=( const error_condition & lhs, const error_condition & rhs ) BOOST_NOEXCEPT
|
735
|
+
{
|
736
|
+
return !( lhs == rhs );
|
737
|
+
}
|
738
|
+
|
739
|
+
inline bool operator==( const error_code & code, const error_condition & condition ) BOOST_NOEXCEPT
|
740
|
+
{
|
741
|
+
return code.category().equivalent( code.value(), condition ) || condition.category().equivalent( code, condition.value() );
|
742
|
+
}
|
743
|
+
|
744
|
+
inline bool operator!=( const error_code & lhs, const error_condition & rhs ) BOOST_NOEXCEPT
|
745
|
+
{
|
746
|
+
return !( lhs == rhs );
|
747
|
+
}
|
748
|
+
|
749
|
+
inline bool operator==( const error_condition & condition, const error_code & code ) BOOST_NOEXCEPT
|
750
|
+
{
|
751
|
+
return code.category().equivalent( code.value(), condition ) || condition.category().equivalent( code, condition.value() );
|
752
|
+
}
|
753
|
+
|
754
|
+
inline bool operator!=( const error_condition & lhs, const error_code & rhs ) BOOST_NOEXCEPT
|
755
|
+
{
|
756
|
+
return !( lhs == rhs );
|
757
|
+
}
|
758
|
+
|
759
|
+
template <class charT, class traits>
|
760
|
+
inline std::basic_ostream<charT,traits>&
|
761
|
+
operator<< (std::basic_ostream<charT,traits>& os, error_code ec)
|
762
|
+
{
|
763
|
+
os << ec.category().name() << ':' << ec.value();
|
764
|
+
return os;
|
765
|
+
}
|
687
766
|
|
688
|
-
|
689
|
-
|
767
|
+
inline std::size_t hash_value( error_code const & ec )
|
768
|
+
{
|
769
|
+
error_category const & cat = ec.category();
|
770
|
+
|
771
|
+
boost::ulong_long_type id = cat.id_;
|
772
|
+
|
773
|
+
if( id == 0 )
|
690
774
|
{
|
691
|
-
|
775
|
+
id = reinterpret_cast<boost::ulong_long_type>( &cat );
|
692
776
|
}
|
693
777
|
|
694
|
-
|
695
|
-
|
778
|
+
boost::ulong_long_type hv = ( boost::ulong_long_type( 0xCBF29CE4 ) << 32 ) + 0x84222325;
|
779
|
+
boost::ulong_long_type const prime = ( boost::ulong_long_type( 0x00000100 ) << 32 ) + 0x000001B3;
|
780
|
+
|
781
|
+
// id
|
782
|
+
|
783
|
+
hv ^= id;
|
784
|
+
hv *= prime;
|
785
|
+
|
786
|
+
// value
|
787
|
+
|
788
|
+
hv ^= static_cast<unsigned>( ec.value() );
|
789
|
+
hv *= prime;
|
790
|
+
|
791
|
+
return static_cast<std::size_t>( hv );
|
792
|
+
}
|
793
|
+
|
794
|
+
// make_* functions for errc::errc_t
|
795
|
+
|
796
|
+
namespace errc
|
797
|
+
{
|
798
|
+
|
799
|
+
// explicit conversion:
|
800
|
+
BOOST_SYSTEM_CONSTEXPR inline error_code make_error_code( errc_t e ) BOOST_NOEXCEPT
|
801
|
+
{
|
802
|
+
return error_code( e, generic_category() );
|
803
|
+
}
|
804
|
+
|
805
|
+
// implicit conversion:
|
806
|
+
BOOST_SYSTEM_CONSTEXPR inline error_condition make_error_condition( errc_t e ) BOOST_NOEXCEPT
|
807
|
+
{
|
808
|
+
return error_condition( e, generic_category() );
|
809
|
+
}
|
810
|
+
|
811
|
+
} // namespace errc
|
812
|
+
|
813
|
+
// error_category default implementation
|
814
|
+
|
815
|
+
inline error_condition error_category::default_error_condition( int ev ) const BOOST_NOEXCEPT
|
816
|
+
{
|
817
|
+
return error_condition( ev, *this );
|
818
|
+
}
|
819
|
+
|
820
|
+
inline bool error_category::equivalent( int code, const error_condition & condition ) const BOOST_NOEXCEPT
|
821
|
+
{
|
822
|
+
return default_error_condition( code ) == condition;
|
823
|
+
}
|
824
|
+
|
825
|
+
inline bool error_category::equivalent( const error_code & code, int condition ) const BOOST_NOEXCEPT
|
826
|
+
{
|
827
|
+
return *this == code.category() && code.value() == condition;
|
828
|
+
}
|
829
|
+
|
830
|
+
inline char const * error_category::message( int ev, char * buffer, std::size_t len ) const BOOST_NOEXCEPT
|
831
|
+
{
|
832
|
+
if( len == 0 )
|
696
833
|
{
|
697
|
-
|
698
|
-
|
699
|
-
boost::system::error_condition bn( condition.value(), *pc_ );
|
700
|
-
return pc_->equivalent( code, bn );
|
701
|
-
}
|
702
|
-
else if( condition.category() == std::generic_category()
|
703
|
-
|| condition.category() == boost::system::generic_category() )
|
704
|
-
{
|
705
|
-
boost::system::error_condition bn( condition.value(),
|
706
|
-
boost::system::generic_category() );
|
834
|
+
return buffer;
|
835
|
+
}
|
707
836
|
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
&condition.category() ) )
|
713
|
-
{
|
714
|
-
boost::system::error_condition bn( condition.value(), *pc2->pc_ );
|
715
|
-
return pc_->equivalent( code, bn );
|
716
|
-
}
|
717
|
-
#endif
|
718
|
-
else
|
719
|
-
{
|
720
|
-
return default_error_condition( code ) == condition;
|
721
|
-
}
|
722
|
-
}
|
723
|
-
|
724
|
-
inline bool error_category::std_category::equivalent( const std::error_code & code,
|
725
|
-
int condition ) const BOOST_NOEXCEPT
|
726
|
-
{
|
727
|
-
if( code.category() == *this )
|
728
|
-
{
|
729
|
-
boost::system::error_code bc( code.value(), *pc_ );
|
730
|
-
return pc_->equivalent( bc, condition );
|
731
|
-
}
|
732
|
-
else if( code.category() == std::generic_category()
|
733
|
-
|| code.category() == boost::system::generic_category() )
|
734
|
-
{
|
735
|
-
boost::system::error_code bc( code.value(),
|
736
|
-
boost::system::generic_category() );
|
737
|
-
|
738
|
-
return pc_->equivalent( bc, condition );
|
739
|
-
}
|
740
|
-
#ifndef BOOST_NO_RTTI
|
741
|
-
else if( std_category const* pc2 = dynamic_cast< std_category const* >(
|
742
|
-
&code.category() ) )
|
743
|
-
{
|
744
|
-
boost::system::error_code bc( code.value(), *pc2->pc_ );
|
745
|
-
return pc_->equivalent( bc, condition );
|
746
|
-
}
|
747
|
-
#endif
|
748
|
-
else if( *pc_ == boost::system::generic_category() )
|
749
|
-
{
|
750
|
-
return std::generic_category().equivalent( code, condition );
|
751
|
-
}
|
752
|
-
else
|
753
|
-
{
|
754
|
-
return false;
|
755
|
-
}
|
837
|
+
if( len == 1 )
|
838
|
+
{
|
839
|
+
buffer[0] = 0;
|
840
|
+
return buffer;
|
756
841
|
}
|
757
842
|
|
843
|
+
#if !defined(BOOST_NO_EXCEPTIONS)
|
844
|
+
try
|
758
845
|
#endif
|
846
|
+
{
|
847
|
+
std::string m = this->message( ev );
|
848
|
+
|
849
|
+
# if defined( BOOST_MSVC )
|
850
|
+
# pragma warning( push )
|
851
|
+
# pragma warning( disable: 4996 )
|
852
|
+
# elif defined(__clang__) && defined(__has_warning)
|
853
|
+
# pragma clang diagnostic push
|
854
|
+
# if __has_warning("-Wdeprecated-declarations")
|
855
|
+
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
856
|
+
# endif
|
857
|
+
# endif
|
858
|
+
|
859
|
+
std::strncpy( buffer, m.c_str(), len - 1 );
|
860
|
+
buffer[ len-1 ] = 0;
|
861
|
+
|
862
|
+
# if defined( BOOST_MSVC )
|
863
|
+
# pragma warning( pop )
|
864
|
+
# elif defined(__clang__) && defined(__has_warning)
|
865
|
+
# pragma clang diagnostic pop
|
866
|
+
# endif
|
867
|
+
|
868
|
+
return buffer;
|
869
|
+
}
|
870
|
+
#if !defined(BOOST_NO_EXCEPTIONS)
|
871
|
+
catch( ... )
|
872
|
+
{
|
873
|
+
return "Message text unavailable";
|
874
|
+
}
|
875
|
+
#endif
|
876
|
+
}
|
877
|
+
|
878
|
+
inline bool error_category::failed( int ev ) const BOOST_NOEXCEPT
|
879
|
+
{
|
880
|
+
return ev != 0;
|
881
|
+
}
|
882
|
+
|
883
|
+
} // namespace system
|
759
884
|
|
760
|
-
} // namespace system
|
761
885
|
} // namespace boost
|
762
886
|
|
763
|
-
|
887
|
+
// generic_error_category implementation
|
764
888
|
|
765
|
-
#
|
766
|
-
|
767
|
-
|
889
|
+
#include <boost/system/detail/generic_category.hpp>
|
890
|
+
|
891
|
+
inline std::string boost::system::detail::generic_error_category::message( int ev ) const
|
892
|
+
{
|
893
|
+
return generic_error_category_message( ev );
|
894
|
+
}
|
895
|
+
|
896
|
+
inline char const * boost::system::detail::generic_error_category::message( int ev, char * buffer, std::size_t len ) const BOOST_NOEXCEPT
|
897
|
+
{
|
898
|
+
return generic_error_category_message( ev, buffer, len );
|
899
|
+
}
|
900
|
+
|
901
|
+
// system_error_category implementation
|
902
|
+
|
903
|
+
#if defined(BOOST_WINDOWS_API)
|
904
|
+
|
905
|
+
#include <boost/system/detail/system_category_win32.hpp>
|
906
|
+
|
907
|
+
inline boost::system::error_condition boost::system::detail::system_error_category::default_error_condition( int ev ) const BOOST_NOEXCEPT
|
908
|
+
{
|
909
|
+
return system_category_default_error_condition_win32( ev );
|
910
|
+
}
|
911
|
+
|
912
|
+
inline std::string boost::system::detail::system_error_category::message( int ev ) const
|
913
|
+
{
|
914
|
+
return system_category_message_win32( ev );
|
915
|
+
}
|
916
|
+
|
917
|
+
inline char const * boost::system::detail::system_error_category::message( int ev, char * buffer, std::size_t len ) const BOOST_NOEXCEPT
|
918
|
+
{
|
919
|
+
return system_category_message_win32( ev, buffer, len );
|
920
|
+
}
|
921
|
+
|
922
|
+
#else // #if defined(BOOST_WINDOWS_API)
|
923
|
+
|
924
|
+
#include <boost/system/detail/system_category_posix.hpp>
|
925
|
+
|
926
|
+
inline boost::system::error_condition boost::system::detail::system_error_category::default_error_condition( int ev ) const BOOST_NOEXCEPT
|
927
|
+
{
|
928
|
+
return system_category_default_error_condition_posix( ev );
|
929
|
+
}
|
930
|
+
|
931
|
+
inline std::string boost::system::detail::system_error_category::message( int ev ) const
|
932
|
+
{
|
933
|
+
return generic_error_category_message( ev );
|
934
|
+
}
|
935
|
+
|
936
|
+
inline char const * boost::system::detail::system_error_category::message( int ev, char * buffer, std::size_t len ) const BOOST_NOEXCEPT
|
937
|
+
{
|
938
|
+
return generic_error_category_message( ev, buffer, len );
|
939
|
+
}
|
940
|
+
|
941
|
+
#endif // #if defined(BOOST_WINDOWS_API)
|
942
|
+
|
943
|
+
// interoperability with std::error_code, std::error_condition
|
944
|
+
|
945
|
+
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
946
|
+
|
947
|
+
#include <boost/system/detail/std_interoperability.hpp>
|
948
|
+
|
949
|
+
inline boost::system::error_category::operator std::error_category const & () const
|
950
|
+
{
|
951
|
+
return boost::system::detail::to_std_category( *this );
|
952
|
+
}
|
953
|
+
|
954
|
+
#endif // #if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
768
955
|
|
769
|
-
#endif //
|
956
|
+
#endif // BOOST_SYSTEM_ERROR_CODE_HPP_INCLUDED
|